Created
February 3, 2021 14:08
Star
You must be signed in to star a gist
Zephyr RTOS Lorawan with Downlink capability
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
.... | |
.... | |
.... | |
void Lorawan_Downlink( uint8_t *Buffer, uint8_t BufferSize, uint8_t Port, uint16_t RSSI, uint16_t SNR ) { | |
printk("Downlink data received: \n"); | |
for(int i=0; i < BufferSize; i++ ) | |
printk("%02X ", Buffer[i]); | |
printk("\n"); | |
printk("Data size: %d\n" , BufferSize ); | |
printk("Data Port: %d\n" , Port ); | |
printk("RSSI: %d\n" , (int16_t)RSSI ); | |
printk("SNR: %d\n" , (int16_t)SNR ); | |
printk("\n\n"); | |
} | |
... | |
... | |
... | |
void main() { | |
... | |
... | |
printk("Starting up Lora node...\n\n"); | |
lora_dev = device_get_binding(DEFAULT_RADIO); | |
if (!lora_dev) { | |
printk("Lora default radio not found.\nExiting program.\n"); | |
return; | |
} | |
lorawan_set_downlink_cb( Lorawan_Downlink ); | |
... | |
... | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment