![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Wireless interface using LoRa technology
Dependencies: AlohaTransceiver RingBuffer SX1276Lib SerialInterfaceProtocol mbed L3PDU
Diff: main.cpp
- Revision:
- 25:faa87315c44f
- Parent:
- 24:2136cf94fedb
- Child:
- 28:0c59edd704a0
--- a/main.cpp Fri Sep 02 04:21:34 2016 +0000 +++ b/main.cpp Fri Sep 02 04:47:05 2016 +0000 @@ -417,15 +417,7 @@ // generate crc packet.generateCrc(); - // create buffer for transmission - uint8_t buffer[8]; - memset(buffer, 0x0, sizeof(buffer)); - - // copy bytes into buffer - packet.serialize(buffer); - - // send to aloha transceiver - aloha.send(buffer, 8, node_id); + aloha.send(&packet); return 0; } @@ -457,15 +449,7 @@ // generate crc packet.generateCrc(); - // create buffer for transmission - uint8_t buffer[8]; - memset(buffer, 0x0, sizeof(buffer)); - - // copy bytes into buffer - packet.serialize(buffer); - - // send to aloha transceiver - aloha.send(buffer, 8, node_id); + aloha.send(&packet); return 0; } @@ -541,15 +525,7 @@ // calculate crc response.generateCrc(); - // serialize and send it - uint8_t buffer[8]; - memset(buffer, 0x0, sizeof(buffer)); - - // copy bytes into buffer - response.serialize(buffer); - - // send to aloha transceiver - aloha.send(buffer, 8, src_addr); + aloha.send(&response); break; }