From f9469f8d728f5a2187fd48aa1737e59b067d733e Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Sun, 22 Jan 2023 16:20:55 +0100 Subject: [PATCH] downlink stuff --- sketch/production.cpp | 15 +++++++++++++++ snippets/downlink.txt | 5 +++++ 2 files changed, 20 insertions(+) create mode 100644 snippets/downlink.txt diff --git a/sketch/production.cpp b/sketch/production.cpp index 26f6b05..9bddc1e 100644 --- a/sketch/production.cpp +++ b/sketch/production.cpp @@ -75,6 +75,21 @@ static void prepareTxFrame( uint8_t port ) } } +void downLinkDataHandle(McpsIndication_t *mcpsIndication) +{ + Serial.printf("+REV DATA:%s,RXSIZE %d,PORT %d\r\n",mcpsIndication->RxSlot?"RXWIN2":"RXWIN1",mcpsIndication->BufferSize,mcpsIndication->Port); + Serial.print("+REV DATA:"); + for(uint8_t i=0;iBufferSize;i++) + { + Serial.printf("%02X",mcpsIndication->Buffer[i]); + } + Serial.println(); + uint32_t color=mcpsIndication->Buffer[0]<<16|mcpsIndication->Buffer[1]<<8|mcpsIndication->Buffer[2]; +} + + + + RTC_DATA_ATTR bool firstrun = true; diff --git a/snippets/downlink.txt b/snippets/downlink.txt new file mode 100644 index 0000000..cafd9ac --- /dev/null +++ b/snippets/downlink.txt @@ -0,0 +1,5 @@ +Handle downlink data: +https://github.com/HelTecAutomation/CubeCell-Arduino/blob/master/libraries/LoRa/examples/LoRaWAN/LoRaWan_downlinkdatahandle/LoRaWan_downlinkdatahandle.ino + +Schedule downlink data: +https://www.thethingsindustries.com/docs/integrations/webhooks/scheduling-downlinks/