mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-08 13:10:29 +00:00
small fix
This commit is contained in:
parent
25007ad121
commit
93907cf4ea
@ -121,7 +121,7 @@ crcResult getLoRa() {
|
||||
enableInterrupt = false;
|
||||
receivedFlag = false;
|
||||
|
||||
int packetSize = RADIOLIB_MODULE.getPacketLength();
|
||||
int packetSize = radio.getPacketLength();
|
||||
if((((packetSize - 6) % sizeof(DataReading) == 0) || ((packetSize - 6) % sizeof(SystemPacket) == 0)) && packetSize > 0) { // packet size should be 6 bytes plus multiple of size of DataReading
|
||||
uint8_t packet[packetSize];
|
||||
uint16_t packetCRC = 0x0000; // CRC Extracted from received LoRa packet
|
||||
@ -129,7 +129,7 @@ crcResult getLoRa() {
|
||||
uint16_t sourceMAC = 0x0000;
|
||||
uint16_t destMAC = 0x0000;
|
||||
|
||||
RADIOLIB_MODULE.readBytes((uint8_t *)&packet, packetSize);
|
||||
radio.readBytes((uint8_t *)&packet, packetSize);
|
||||
|
||||
destMAC = (packet[0] << 8) | packet[1];
|
||||
sourceMAC = (packet[2] << 8) | packet[3];
|
||||
|
Loading…
Reference in New Issue
Block a user