//not sure what they are doing to the PATABLE since basically only the first byte is used and it's only 8 bytes long. So I think they end up filling the PATABLE fully with 0xFF
// From dumps channels are anything between 0x00 and 0xC5 on V1.
// But 0x00 and 0xB8 should be avoided on V2 since they are used for bind.
// Below code make sure channels are between 0x02 and 0xA0, spaced with a minimum of 2 and not ordered (RX only use the 1st channel unless there is an issue).
{// Send identifier packet for 2.65sec. This is how the RX learns the hopping table after a bind. Why it's not part of the bind like V1 is a mistery...
state--;
packet[0]=0x07;// 8 bytes to follow
// Send hopping freq
for(uint8_ti=0;i<CORONA_RF_NUM_CHANNELS;i++)
packet[i+1]=hopping_frequency[i];
// Send TX ID
for(uint8_ti=0;i<CORONA_ADDRESS_LENGTH;i++)
packet[i+4]=rx_tx_addr[i];
packet[8]=0;
packet_period=6647;
// Set channel
CC2500_WriteReg(CC2500_0A_CHANNR,0x00);
}
}
else
{// Build bind packets
if(sub_protocol==COR_V1)
{// V1
if(bind_counter&1)
{// Send TX ID
packet[0]=0x04;// 5 bytes to follow
for(uint8_ti=0;i<CORONA_ADDRESS_LENGTH;i++)
packet[i+1]=rx_tx_addr[i];
packet[5]=0xCD;// Unknown but seems to be always the same value for V1
packet_period=3689;
}
else
{// Send hopping freq
packet[0]=0x03;// 4 bytes to follow
for(uint8_ti=0;i<CORONA_RF_NUM_CHANNELS+1;i++)
packet[i+1]=hopping_frequency[i];
// Not sure what the last byte (+1) is for now since only the first 3 channels are used...
packet_period=3438;
}
}
else
{// V2
packet[0]=0x04;// 5 bytes to follow
for(uint8_ti=0;i<CORONA_ADDRESS_LENGTH;i++)
packet[i+1]=rx_tx_addr[i];
packet[5]=0x00;// Unknown but seems to be always the same value for V2