Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Firmware/LoRaSerial/LoRaSerial.ino
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const int FIRMWARE_VERSION_MINOR = 0;
#define UNIQUE_ID_BYTES 16 //Number of bytes in the unique ID

//Frame lengths
#define MP_HEARTBEAT_BYTES 1 //Number of data bytes in the MP_HEARTBEAT frame
#define MP_HEARTBEAT_BYTES (sizeof(uint8_t) + sizeof(unsigned long)) //Number of data bytes in the MP_HEARTBEAT frame
#define P2P_FIND_PARTNER_BYTES sizeof(unsigned long) //Number of data bytes in the FIND_PARTNER frame
#define P2P_SYNC_CLOCKS_BYTES (sizeof(uint8_t) + sizeof(unsigned long)) //Number of data bytes in the SYNC_CLOCKS frame
#define P2P_ZERO_ACKS_BYTES sizeof(unsigned long) //Number of data bytes in the ZERO_ACKS frame
Expand Down
25 changes: 13 additions & 12 deletions Firmware/LoRaSerial/Radio.ino
Original file line number Diff line number Diff line change
Expand Up @@ -931,8 +931,7 @@ bool xmitDatagramP2PSyncClocks()
radioCallHistory[RADIO_CALL_xmitDatagramP2PSyncClocks] = currentMillis;

startOfData = endOfTxData;
memcpy(endOfTxData, &channelNumber, sizeof(channelNumber));
endOfTxData += sizeof(channelNumber);
*endOfTxData++ = channelNumber;

memcpy(endOfTxData, &currentMillis, sizeof(currentMillis));
endOfTxData += sizeof(unsigned long);
Expand Down Expand Up @@ -1149,18 +1148,20 @@ bool xmitDatagramMpHeartbeat()
radioCallHistory[RADIO_CALL_xmitDatagramMpHeartbeat] = millis();

startOfData = endOfTxData;
memcpy(endOfTxData, &channelNumber, sizeof(channelNumber));
endOfTxData += sizeof(channelNumber);
*endOfTxData++ = channelNumber;

memcpy(endOfTxData, &currentMillis, sizeof(currentMillis));
endOfTxData += sizeof(unsigned long);

/*
endOfTxData ---.
|
V
+----------+---------+----------+------------+---------+----------+
| Optional | | Optional | Optional | Channel | |
| NET ID | Control | C-Timer | SF6 Length | Number | Trailer |
| 8 bits | 8 bits | 2 bytes | 8 bits | 1 byte | n Bytes |
+----------+---------+----------+------------+---------+----------+
endOfTxData ---.
|
V
+----------+---------+----------+------------+---------+---------+----------+
| Optional | | Optional | Optional | Channel | | |
| NET ID | Control | C-Timer | SF6 Length | Number | Millis | Trailer |
| 8 bits | 8 bits | 2 bytes | 8 bits | 1 byte | 4 bytes | n Bytes |
+----------+---------+----------+------------+---------+---------+----------+
*/

//Verify the data length
Expand Down
1 change: 0 additions & 1 deletion Firmware/LoRaSerial/States.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,6 @@ void updateRadioState()
startChannelTimer();
channelTimerStart -= settings.maxDwellTime;
syncChannelTimer(txSyncClocksUsec);
triggerEvent(TRIGGER_RX_SYNC_CLOCKS);

if (settings.debugSync)
{
Expand Down