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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LoraComms.h Source File

LoraComms.h

00001 /**
00002  * Code for connecting to network and sending/receiving data
00003  */
00004 
00005 #ifndef LORA_COMMS_H
00006 #define LORA_COMMS_H
00007 
00008 #include "mDot.h"
00009 #include "ChannelPlans.h"
00010 
00011 /**
00012  * Create a new mDot instance with channel plan defined in the cpp file, and
00013  * configure the network name etc. Return the mDot instance.
00014  * Parameters:
00015  * radioEvents: A custom event handler to attach to the new mdot instance.
00016  */
00017 mDot* initializeLora();
00018 
00019 /**
00020  * Print the lora config to debug serial
00021  */
00022 void display_config(mDot* dot);
00023 
00024 /**
00025  * Update the lora config
00026  */
00027 void update_ota_config_name_phrase(mDot* dot, std::string network_name, 
00028         std::string network_passphrase, uint8_t frequency_sub_band,
00029         lora::NetworkType network_type, uint8_t ack);
00030 
00031 /**
00032  * Update the number of packets to request acks on, and how many lost acks to
00033  * consider a disconnect
00034  */
00035 void update_network_link_check_config(mDot* dot, uint8_t link_check_count,
00036         uint8_t link_check_threshold);
00037 
00038 /**
00039  * Continue attempting to join the network until successful
00040  */
00041 void join_network(mDot* dot);
00042 
00043 #endif