Microchip® Advanced Software Framework

otau.c File Reference

OTAU implementation.

Copyright (c) 2018 - 2019 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"
#include "asf.h"
#include "otau.h"
#include "system.h"
#include "sysTimer.h"
#include "common_nvm.h"
#include "miwi_api.h"
#include "mimem.h"
#include "miqueue.h"
#include "otau_notify.h"
#include "otau_upgrade.h"
#include "otau_debug.h"

Functions

static bool addDataHandleTableEntry (uint8_t domainId, uint8_t messageId, addr_mode_t addrMode, uint8_t *addr, uint8_t handle)
 
uint8_t * get_node_address (addr_mode_t addr_mode)
 
static bool getAddressFromDataHandleTable (uint8_t handle, uint8_t *domainId, uint8_t *messageId, uint8_t *addrMode, uint8_t *addr)
 
static void initDataHandleTable (void)
 
static void otauDataConf (uint8_t msgConfHandle, miwi_status_t status, uint8_t *msgPointer)
 
static void otauDataInd (RECEIVED_MESH_MESSAGE *ind)
 
void otauDataSend (addr_mode_t addr_mode, uint8_t *addr, void *payload, uint16_t len)
 
void otauGetServerDetails (addr_mode_t addr_mode, uint8_t *addr)
 
void otauHandleMsg (otau_domain_msg_t *otau_domain_msg)
 
void otauInit (void)
 
void otauLed (otau_led_t led_state)
 
void otauRcvdFrame (otau_rcvd_frame_t *frame)
 
void otauResetDevice (void)
 
void otauSetServerDetails (addr_mode_t addr_mode, uint8_t *addr)
 
void otauTask (void)
 
void otauTimerStart (otau_domain_t domain_code, uint32_t interval, otau_timer_mode_t mode)
 
void otauTimerStop (otau_domain_t domain_code)
 
void reverseMemcpy (uint8_t *dst, uint8_t *src, uint8_t len)
 

Variables

DataHandleTable_t dataHandleTable [DATA_HANDLE_TABLE_SIZE]
 
static uint8_t msgHandle = 0
 
MiQueue_t networkFrame
 
static SYS_Timer_t otauDebugTimer
 
static bool otauInited = false
 
static SYS_Timer_t otauNotifyTimer
 
static SYS_Timer_t otauUpgradeTimer
 
uint16_t pan_id = MY_PAN_ID
 
uint8_t seq_no = 0
 
node_address_t serverAddress
 
uint16_t shortAddress
 

static bool addDataHandleTableEntry ( uint8_t  domainId,
uint8_t  messageId,
addr_mode_t  addrMode,
uint8_t *  addr,
uint8_t  handle 
)
static
uint8_t* get_node_address ( addr_mode_t  addr_mode)
static bool getAddressFromDataHandleTable ( uint8_t  handle,
uint8_t *  domainId,
uint8_t *  messageId,
uint8_t *  addrMode,
uint8_t *  addr 
)
static
static void initDataHandleTable ( void  )
static
void otauGetServerDetails ( addr_mode_t  addr_mode,
uint8_t *  addr 
)
void otauLed ( otau_led_t  led_state)

References OTAU_LED_OFF, and OTAU_LED_ON.

Referenced by otauNotifyTimerHandler().

void otauResetDevice ( void  )
void otauSetServerDetails ( addr_mode_t  addr_mode,
uint8_t *  addr 
)
void reverseMemcpy ( uint8_t *  dst,
uint8_t *  src,
uint8_t  len 
)

References i.

uint8_t msgHandle = 0
static

Referenced by otauDataSend().

MiQueue_t networkFrame
SYS_Timer_t otauDebugTimer
static
bool otauInited = false
static

Referenced by otauTask().

SYS_Timer_t otauNotifyTimer
static
SYS_Timer_t otauUpgradeTimer
static
uint16_t pan_id = MY_PAN_ID
uint8_t seq_no = 0
node_address_t serverAddress

Referenced by otauClientSendNotify().

uint16_t shortAddress

Referenced by get_node_address(), and otauTask().