lorawan_downlink
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
lorawan_downlink [2017/12/12 08:24] – [4.1. Autonomo with LoRaBee] samer | lorawan_downlink [2017/12/12 08:24] – [4.2. Arduino with Dragino Shield] samer | ||
---|---|---|---|
Line 69: | Line 69: | ||
<code c++> | <code c++> | ||
- | void receiveData() { | + | case EV_TXCOMPLETE: |
- | // After we have send some data, we can receive some data | + | |
- | // First we make a buffer | + | if (LMIC.dataLen) { |
- | uint8_t payload[64]; | + | // data received in rx slot after tx |
- | // Now we fill the buffer and | + | |
- | // len = the size of the data | + | |
- | uint16_t len = LoRaBee.receive(payload, 64); | + | |
- | String HEXPayload = ""; | + | } |
- | + | ||
- | // When there is no payload the lorabee will return 131 (0x83) | + | |
- | // I filter this out | + | |
- | if (payload[0] != 131) { | + | |
- | for (int i = 0; i < len; i++) { | + | |
- | | + | |
- | } | + | |
- | + | ||
- | | + | |
- | | + | |
- | } | + | |
- | if (HEXPayload == "off" | + | |
- | digitalWrite(LED_BUILTIN, | + | |
- | } | + | |
- | debugSerial.println(HEXPayload); | + | |
- | // | + | |
- | } else { | + | |
- | debugSerial.println("no payload" | + | |
- | } | + | |
- | } | + | |
</ | </ | ||
- | |||
===== -. Selecting the Receive Windows ===== | ===== -. Selecting the Receive Windows ===== | ||
lorawan_downlink.txt · Last modified: 2021/08/28 09:53 by samer