LORAWAN Demo Application.
Copyright (c) 2019 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | LORAWAN_NW_JOINED 0x01 |
Macro to check the LoRaWAN stack status attribute network joined bit. More... | |
Typedefs | |
typedef enum _AppTaskIds_t | AppTaskIds_t |
typedef enum _AppTaskState_t | AppTaskState_t |
Enumerations | |
enum | _AppTaskIds_t { DISPLAY_TASK_HANDLER, PROCESS_TASK_HANDLER, APP_TASKS_COUNT } |
enum | _AppTaskState_t { RESTORE_BAND_STATE, DEMO_CERT_APP_STATE, DEMO_APP_STATE, JOIN_SEND_STATE } |
Functions | |
void | check_stack_status (void) |
void | demo_appdata_callback (void *appHandle, appCbParams_t *data) |
Callback function for the ending of Bidirectional communication of Application data. More... | |
void | demo_joindata_callback (StackRetStatus_t status) |
void | dev_eui_read (void) |
Reads the MAC EUI from the EDBG Controller of the XPro Board. More... | |
void | mote_demo_init (void) |
Function to Initialize the Demo application. More... | |
StackRetStatus_t | mote_set_parameters (IsmBand_t ismBand, const uint16_t index) |
void | print_application_config (void) |
void | print_array (uint8_t *data, uint8_t length) |
void | print_default_parameters (void) |
void | print_stack_status (StackRetStatus_t status) |
void | serial_data_handler (void) |
Pulls the data from UART when activated. More... | |
StackRetStatus_t | set_device_type (EdClass_t ed_class) |
StackRetStatus_t | set_join_parameters (ActivationType_t activation_type) |
void | set_multicast_params (void) |
#define LORAWAN_NW_JOINED 0x01 |
Macro to check the LoRaWAN stack status attribute network joined bit.
Referenced by processRunRestoreBand().
typedef enum _AppTaskIds_t AppTaskIds_t |
typedef enum _AppTaskState_t AppTaskState_t |
enum _AppTaskIds_t |
enum _AppTaskState_t |
void check_stack_status | ( | void | ) |
void demo_appdata_callback | ( | void * | appHandle, |
appCbParams_t * | data | ||
) |
Callback function for the ending of Bidirectional communication of Application data.
References appPostTask(), appTaskState, demo_handle_evt_rx_data(), DISPLAY_TASK_HANDLER, _appCbParams::evt, JOIN_SEND_STATE, LED_AMBER, LED_GREEN, LORAWAN_BUSY, LORAWAN_EVT_RX_DATA_AVAILABLE, LORAWAN_EVT_TRANSACTION_COMPLETE, LORAWAN_FCNTR_ERROR, LORAWAN_FCNTR_ERROR_REJOIN_NEEDED, LORAWAN_INVALID_BUFFER_LENGTH, LORAWAN_INVALID_MTYPE, LORAWAN_INVALID_PACKET, LORAWAN_INVALID_PARAMETER, LORAWAN_INVALID_REQUEST, LORAWAN_KEYS_NOT_INITIALIZED, LORAWAN_MAC_PAUSED, LORAWAN_MCAST_HDR_INVALID, LORAWAN_MIC_ERROR, LORAWAN_NO_ACK, LORAWAN_NO_CHANNELS_FOUND, LORAWAN_NWK_JOIN_IN_PROGRESS, LORAWAN_NWK_NOT_JOINED, LORAWAN_RADIO_BUSY, LORAWAN_RADIO_CHANNEL_BUSY, LORAWAN_RADIO_DATA_SIZE, LORAWAN_RADIO_INVALID_REQ, LORAWAN_RADIO_NO_DATA, LORAWAN_RADIO_OUT_OF_RANGE, LORAWAN_RADIO_SUCCESS, LORAWAN_RADIO_UNSUPPORTED_ATTR, LORAWAN_RESOURCE_UNAVAILABLE, LORAWAN_SILENT_IMMEDIATELY_ACTIVE, LORAWAN_SUCCESS, LORAWAN_TX_TIMEOUT, lTimerId, off, on, _appCbParams::param, _appCbParams::rxData, set_LED_data(), SwTimerStop(), and _appCbParams::transCmpl.
Referenced by mote_demo_init().
void demo_joindata_callback | ( | StackRetStatus_t | status | ) |
References appPostTask(), appTaskState, DEV_ADDR, DISPLAY_TASK_HANDLER, JOIN_SEND_STATE, joined, LED_AMBER, LED_GREEN, LORAWAN_GetAttr(), LORAWAN_MIC_ERROR, LORAWAN_NO_CHANNELS_FOUND, LORAWAN_SUCCESS, LORAWAN_TX_TIMEOUT, MCAST_ENABLE, NULL, off, on, PDS_StoreAll(), print_application_config(), and set_LED_data().
Referenced by mote_demo_init().
void dev_eui_read | ( | void | ) |
Reads the MAC EUI from the EDBG Controller of the XPro Board.
References demoDevEui, edbg_eui_read_eui64(), i, and j.
void mote_demo_init | ( | void | ) |
Function to Initialize the Demo application.
Function to Initialize the Demo application.
References appPostTask(), appTaskState, bandStrings, bandTable, demo_appdata_callback(), DEMO_CERT_APP_STATE, demo_joindata_callback(), demoTimerCb(), demoTimerId, DISPLAY_TASK_HANDLER, i, ISMBAND, LORAWAN_GetAttr(), LORAWAN_Init(), MS_TO_US, NULL, PDS_IsRestorable(), PDS_RestoreAll(), resource_init(), rxchar, sio2host_rx(), STACK_VER, startReceiving, SW_TIMEOUT_RELATIVE, and SwTimerStart().
StackRetStatus_t mote_set_parameters | ( | IsmBand_t | ismBand, |
const uint16_t | index | ||
) |
References appPostTask(), appTaskState, bandStrings, bandTable, CH_PARAM_STATUS, _ChannelParameters::channelAttr, _ChannelParameters::channelId, CRYPTODEVICE_ENABLED, DISPLAY_TASK_HANDLER, ISM_AU915, ISM_NA915, JOIN_BACKOFF_ENABLE, JOIN_SEND_STATE, LORAWAN_Join(), LORAWAN_Reset(), LORAWAN_SetAttr(), LORAWAN_SUCCESS, MAX_NA_CHANNELS, MAX_SUBBAND_CHANNELS, print_stack_status(), set_device_type(), set_join_parameters(), _ChannelAttr::status, and SUBBAND.
Referenced by processRunDemoApp().
void print_application_config | ( | void | ) |
References ACTIVATION_BY_PERSONALIZATION, CLASS_A, CLASS_C, CONFIRMED, EDCLASS, LORAWAN_GetAttr(), NULL, OVER_THE_AIR_ACTIVATION, and UNCONFIRMED.
Referenced by demo_joindata_callback(), and processRunRestoreBand().
void print_array | ( | uint8_t * | data, |
uint8_t | length | ||
) |
Referenced by cert_app_timer_callback(), cert_set_join_parameters(), set_join_parameters(), and set_multicast_params().
void print_default_parameters | ( | void | ) |
void print_stack_status | ( | StackRetStatus_t | status | ) |
References LORAWAN_BUSY, LORAWAN_FCNTR_ERROR_REJOIN_NEEDED, LORAWAN_INVALID_BUFFER_LENGTH, LORAWAN_INVALID_PARAMETER, LORAWAN_INVALID_REQUEST, LORAWAN_KEYS_NOT_INITIALIZED, LORAWAN_MAC_PAUSED, LORAWAN_NO_CHANNELS_FOUND, LORAWAN_NWK_JOIN_IN_PROGRESS, LORAWAN_NWK_NOT_JOINED, LORAWAN_SILENT_IMMEDIATELY_ACTIVE, and LORAWAN_SUCCESS.
Referenced by cert_app_init(), cert_app_timer_callback(), cert_appdata_callback(), cert_handle_cert_rx_data(), cert_joindata_callback(), mote_set_parameters(), and processJoinAndSend().
StackRetStatus_t set_device_type | ( | EdClass_t | ed_class | ) |
References CLASS_B, CLASS_C, EDCLASS, LORAWAN_SetAttr(), LORAWAN_SUCCESS, and set_multicast_params().
Referenced by mote_set_parameters().
StackRetStatus_t set_join_parameters | ( | ActivationType_t | activation_type | ) |
References ACTIVATION_BY_PERSONALIZATION, APP_KEY, APPS_KEY, demoAppKey, demoAppsKey, demoDevAddr, demoDevEui, demoJoinEui, demoNwksKey, DEV_ADDR, DEV_EUI, JOIN_EUI, LORAWAN_SetAttr(), LORAWAN_SUCCESS, NWKS_KEY, and print_array().
Referenced by mote_set_parameters().
void set_multicast_params | ( | void | ) |
References _LorawanMcastDatarate::datarate, _ReceiveWindow2Params::dataRate, demoMcastAppsKey, demoMcastDevAddr, demoMcastEnable, demoMcastGroupId, demoMcastNwksKey, _LorawanMcastDlFreqeuncy::dlFrequency, _ReceiveWindow2Params::frequency, _LorawanMcastDevAddr::groupId, _LorawanMcastAppSkey::groupId, _LorawanMcastNwkSkey::groupId, _LorawanMcastDatarate::groupId, _LorawanMcastDlFreqeuncy::groupId, _LorawanMcastStatus::groupId, LORAWAN_GetAttr(), LORAWAN_SESSIONKEY_LENGTH, LORAWAN_SetAttr(), LORAWAN_SetMulticastParam(), LORAWAN_SUCCESS, MCAST_APPS_KEY, MCAST_DATARATE, _LorawanMcastDevAddr::mcast_dev_addr, MCAST_ENABLE, MCAST_FREQUENCY, MCAST_GROUP_ADDR, MCAST_NWKS_KEY, _LorawanMcastAppSkey::mcastAppSKey, _LorawanMcastNwkSkey::mcastNwkSKey, NULL, print_array(), RX2_WINDOW_PARAMS, and _LorawanMcastStatus::status.
Referenced by set_device_type().