OptConnect ema:Play User Manual page 48

Table of Contents

Advertisement

This various software components or functions that are used in this sample project are detailed below:
emaPlay_mgmt_URC_handler(): This function is called as frequently as possible. It handles any
asynchronous ema URC's that have been received over the emaLink interface. The data is written to a FIFO
queue(mgmt_uart_async_rx_q) at the interrupt level during the receive data callback function
(emaPlay_mgmt_rx_cb). The entire URC verbose message is retrieved. The function
emaPlay_mgmt_process_URC() will process the URC according to the requirements of the application.
emaPlay_system_task(): This function is the main state machine that handles the control of ema, as well
as transacting any relevant data to and from the IoT cloud platform. Once the demo is started, the state
machine powers on ema and the cellular module, checks network status, checks/starts the data session,
initializes the Leaf agent, then enters a normal operations state. User events and periodic/delta statistic
messages will create and build JSON messages to be sent to the cloud.
emaPlay_scan_analog_inputs(): This function scans and debounces the system's analog inputs.
emaPlay_read_temp_humidiity(): This function communicates over i2c to a temperature/humidity
sensor and converts the data into degrees F and relative humidity %.
emaPlay_check_events(): This function processes any of the digital events that can take place from either
the push buttons or the user digital inputs. The low-level reading and debouncing of the actual MCU
pin(s) occurs on a timer interrupt.
dbg_task(): This function handles any queued console debug output as well as reading any console input.
© OptConnect Management, LLC 2020. All rights reserved. Revision 1.0
48

Advertisement

Table of Contents
loading

Table of Contents