A simple program that connects to University of Queensland's Lora network and requests a joke, then prints the joke to usb serial.

Dependencies:   fota-mdot libmDot MTS-Serial

Committer:
WilliamAF
Date:
Sat Sep 28 00:56:31 2019 +0000
Revision:
1:ca2d24ec97ba
Parent:
0:fa546fb96b80
Copy and paste the right mbed-os and libmdot

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WilliamAF 0:fa546fb96b80 1 /**
WilliamAF 0:fa546fb96b80 2 * Code for connecting to network and sending/receiving data
WilliamAF 0:fa546fb96b80 3 */
WilliamAF 0:fa546fb96b80 4
WilliamAF 0:fa546fb96b80 5 #ifndef LORA_COMMS_H
WilliamAF 0:fa546fb96b80 6 #define LORA_COMMS_H
WilliamAF 0:fa546fb96b80 7
WilliamAF 0:fa546fb96b80 8 #include "mDot.h"
WilliamAF 0:fa546fb96b80 9 #include "ChannelPlans.h"
WilliamAF 0:fa546fb96b80 10
WilliamAF 0:fa546fb96b80 11 /**
WilliamAF 0:fa546fb96b80 12 * Create a new mDot instance with channel plan defined in the cpp file, and
WilliamAF 0:fa546fb96b80 13 * configure the network name etc. Return the mDot instance.
WilliamAF 0:fa546fb96b80 14 * Parameters:
WilliamAF 0:fa546fb96b80 15 * radioEvents: A custom event handler to attach to the new mdot instance.
WilliamAF 0:fa546fb96b80 16 */
WilliamAF 0:fa546fb96b80 17 mDot* initializeLora();
WilliamAF 0:fa546fb96b80 18
WilliamAF 0:fa546fb96b80 19 /**
WilliamAF 0:fa546fb96b80 20 * Print the lora config to debug serial
WilliamAF 0:fa546fb96b80 21 */
WilliamAF 0:fa546fb96b80 22 void display_config(mDot* dot);
WilliamAF 0:fa546fb96b80 23
WilliamAF 0:fa546fb96b80 24 /**
WilliamAF 0:fa546fb96b80 25 * Update the lora config
WilliamAF 0:fa546fb96b80 26 */
WilliamAF 0:fa546fb96b80 27 void update_ota_config_name_phrase(mDot* dot, std::string network_name,
WilliamAF 0:fa546fb96b80 28 std::string network_passphrase, uint8_t frequency_sub_band,
WilliamAF 0:fa546fb96b80 29 lora::NetworkType network_type, uint8_t ack);
WilliamAF 0:fa546fb96b80 30
WilliamAF 0:fa546fb96b80 31 /**
WilliamAF 0:fa546fb96b80 32 * Update the number of packets to request acks on, and how many lost acks to
WilliamAF 0:fa546fb96b80 33 * consider a disconnect
WilliamAF 0:fa546fb96b80 34 */
WilliamAF 0:fa546fb96b80 35 void update_network_link_check_config(mDot* dot, uint8_t link_check_count,
WilliamAF 0:fa546fb96b80 36 uint8_t link_check_threshold);
WilliamAF 0:fa546fb96b80 37
WilliamAF 0:fa546fb96b80 38 /**
WilliamAF 0:fa546fb96b80 39 * Continue attempting to join the network until successful
WilliamAF 0:fa546fb96b80 40 */
WilliamAF 0:fa546fb96b80 41 void join_network(mDot* dot);
WilliamAF 0:fa546fb96b80 42
WilliamAF 0:fa546fb96b80 43 #endif