cmatteri & kobuki:
I used the information that both of you provided and created the following example demo repeater code (4DGL) for use with the Vue. Only the relevant portion is shown:
//
//
//
func main()
initialize(); // Sets up the display.
Radio.begin(); // Configure the CC1101 registers.
rxHopIndex := 0; // Set the initial hopIndex values.
txHopIndex := 25;
Radio.setFrequency(rxHopIndex);
Radio.receive(); // Begin reception.
repeat
if (radioStatus & CC1101_RX_END)
radioStatus &= ~CC1101_RX_END;
repeatPacket();
Radio.hop(); // Increments both hop indexes.
Radio.setFrequency(rxHopIndex);
Radio.receive();
endif
forever
endfunc
//
//
//
func repeatPacket()
var crc;
for (i := 0; i < 10; i++)
txBuffer[i] := rxBuffer[i];
next
switch (txBuffer[0])
case 0x50:
case 0x80:
txBuffer[6] := 0x85; txBuffer[7] := 0x00;
txBuffer[8] := 0x85; txBuffer[9] := 0x00;
break;
case 0x20:
case 0x30:
case 0x70:
case 0x90:
case 0xA0:
case 0xE0:
txBuffer[6] := 0x05; txBuffer[7] := 0x08;
txBuffer[8] := 0x05; txBuffer[9] := 0x08;
break;
default:
Radio.flush();
return;
endswitch
crc := Radio.calcCrc(txBuffer, 8);
txBuffer[6] := crc >> 8;
txBuffer[7] := crc & 0xFF;
Radio.setFrequency(txHopIndex);
Radio.transmit(txBuffer, 10);
gfx_GoTo(30, 0);
putstr(" ");
gfx_GoTo(30, 0);
print([DEC2Z] rxHopIndex, "\t");
for (i := 0; i < 10; i++)
print([HEX2] rxBuffer[i], "\t");
next
gfx_GoTo(50, 0);
putstr(" ");
gfx_GoTo(50, 0);
print([DEC2Z] txHopIndex, "\t");
Radio.reverseBits(txBuffer, 10); // Reverse the bits for printing.
for (i := 0; i < 10; i++)
print([HEX2] txBuffer[i], "\t");
next
endfunc
It has run flawlessly for 48 hours!