Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
|
Chili temperature sensing app declarations. More...
Go to the source code of this file.
Macros | |
#define | APP_WAKEUPINTERVALL 5 |
wakeup interval for application [seconds] More... | |
#define | APP_TIMEOUTINTERVALL 15 |
timeout interval for end devices that havent sent anything for some time [seconds] More... | |
#define | APP_DEVICETIMEOUT 1000 |
device timeout in [ms] for max. time staying awake More... | |
#define | APP_DEVICE_MAX_RETRIES 1 |
maximum number of retries for device before disconnection and re-scanning More... | |
#define | APP_MAX_DEVICES 32 |
maximum devices/sensors that can connect to coordinator More... | |
#define | APP_DEFAULT_PDN_MODE PDM_DPD |
default powerdown mode for device/sensor More... | |
#define | APP_USE_EXTERNAL_CLOCK 1 |
use clock from cax8210 xtal oscillator (when 1) or nano120 internal RC oscillator as system clock (when 0) More... | |
#define | APP_LQI_LIMIT 75 |
link quality limit for joining coordinator More... | |
#define | APP_ED_LIMIT 50 |
energy detect limit (triggers warning) More... | |
#define | APP_VBAT_LIMIT 1862 /* = 2.5 V */ |
battery voltage limit when unplugged (triggers warning) More... | |
#define | APP_REPORT_VBATT 1 |
report battery voltage with every reading (otherwise just issue warning if it drops below APP_VBAT_LIMIT) More... | |
#define | APP_REPORT_LQI 1 |
report lqi values (both from device and coordinator) More... | |
#define | APP_REPORT_ED 1 |
report ed values (both from device and coordinator) More... | |
#define | APP_COORD_REPORTN 1 |
report every nth data package More... | |
#define | APP_COORD_SREINIT 0 |
soft re-initialisation of coordinator More... | |
#define | APP_USE_DEBUG 0 |
use over-air debug mode More... | |
#define | MAC_PANID 0xCA5C |
#define | MAC_SHORTADD 0xCA00 |
#define | MAC_LONGADD |
#define | MAC_CHANNELLIST |
#define | APP_ST_NORMAL 0 |
Application disabled, EVBME. More... | |
#define | APP_ST_COORDINATOR 1 |
Network Coordinator. More... | |
#define | APP_ST_DEVICE 2 |
Sensing Device. More... | |
#define | APP_CST_DONE 0x00 |
communication completed More... | |
#define | APP_CST_WAKEUP_REQUESTED 0x01 |
wakeup pkt requested (device) More... | |
#define | APP_CST_WAKEUP_CONFIRMED 0x02 |
wakeup pkt confirmed (device) More... | |
#define | APP_CST_WAKEUP_RECEIVED 0x03 |
wakeup pkt received (coord) More... | |
#define | APP_CST_C_DATA_REQUESTED 0x04 |
coord data requested (coord) More... | |
#define | APP_CST_C_DATA_CONFIRMED 0x05 |
coord data confirmed (coord) More... | |
#define | APP_CST_C_DATA_RECEIVED 0x06 |
coord data received (device) More... | |
#define | APP_CST_D_DATA_REQUESTED 0x07 |
device data requested (device) More... | |
#define | APP_CST_GO_POWERDOWN 0x08 |
go into powerdown (device) More... | |
#define | APP_CST_ASSOC_REQUESTED 0x09 |
#define | APP_CST_SCANNING 0x0A |
#define | PT_MSDU_D_WAKEUP 0x01 |
device wakeup indication More... | |
#define | PT_MSDU_C_DATA 0x02 |
coordinator data More... | |
#define | PT_MSDU_D_DATA 0x03 |
device data More... | |
Functions | |
void | TEMPSENSE_APP_Handler (struct ca821x_dev *pDeviceRef) |
TEMPSENSE Application Handler. More... | |
void | TEMPSENSE_APP_Initialise (struct ca821x_dev *pDeviceRef) |
TEMPSENSE Application Initialisation of MAC etc. More... | |
int | TEMPSENSE_APP_UpStreamDispatch (struct SerialBuffer *SerialRxBuffer, struct ca821x_dev *pDeviceRef) |
TEMPSENSE Dispatch Branch (UpStream, Serial) More... | |
void | TEMPSENSE_APP_SwitchMode (u8_t mode) |
TEMPSENSE Switch Mode. More... | |
void | TEMPSENSE_APP_InitPIB (struct ca821x_dev *pDeviceRef) |
TEMPSENSE Application Initialisation of MAC PIB. More... | |
u8_t | TEMPSENSE_APP_GetTempVal (void) |
TEMPSENSE App. More... | |
u16_t | TEMPSENSE_APP_GetVoltsVal (void) |
TEMPSENSE App. More... | |
u32_t | TEMPSENSE_APP_GetScanChannels (void) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_PrintScanChannels (void) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_PrintSeconds (void) |
Prints AboluteTime in Seconds. More... | |
void | TEMPSENSE_APP_LED_Handler (void) |
module LEDs signalling More... | |
void | TEMPSENSE_APP_Coordinator_Handler (struct ca821x_dev *pDeviceRef) |
TEMPSENSE Application Handler for Coordinator. More... | |
void | TEMPSENSE_APP_Coordinator_Initialise (struct ca821x_dev *pDeviceRef) |
TEMPSENSE Application Initialisation for Coordinator. More... | |
void | TEMPSENSE_APP_Coordinator_Start (struct ca821x_dev *pDeviceRef) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Coordinator_ProcessScanCnf (struct MLME_SCAN_confirm_pset *params, struct ca821x_dev *pDeviceRef) |
Coordinator Process incoming Scan Confirm. More... | |
void | TEMPSENSE_APP_Coordinator_AssociateResponse (struct MLME_ASSOCIATE_indication_pset *params, struct ca821x_dev *pDeviceRef) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Coordinator_ProcessDataInd (struct MCPS_DATA_indication_pset *params, struct ca821x_dev *pDeviceRef) |
Coordinator Process incoming Data Indications. More... | |
void | TEMPSENSE_APP_Coordinator_ProcessDataCnf (struct MCPS_DATA_confirm_pset *params, struct ca821x_dev *pDeviceRef) |
Coordinator Process incoming Data Confirmations. More... | |
void | TEMPSENSE_APP_Coordinator_DisplayData (u8_t device, u8_t edcoord, struct MCPS_DATA_indication_pset *params, struct ca821x_dev *pDeviceRef) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Coordinator_CheckTimeouts (struct ca821x_dev *pDeviceRef) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Coordinator_CheckVbatt (u16_t vbat) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Coordinator_CheckLQI (u8_t lqi_ts, u8_t lqi_coord) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Coordinator_CheckED (u8_t ed_ts, u8_t ed_coord) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Coordinator_SoftReinit (struct ca821x_dev *pDeviceRef) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Coordinator_ReportStatus (void) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Device_Handler (struct ca821x_dev *pDeviceRef) |
TEMPSENSE Application Handler for Sensor Device. More... | |
void | TEMPSENSE_APP_Device_Initialise (struct ca821x_dev *pDeviceRef) |
TEMPSENSE Application Initialisation for Sensor Device. More... | |
void | TEMPSENSE_APP_Device_GetLongAddress (void) |
TEMPSENSE Get Device LongAddress from Dataflash. More... | |
void | TEMPSENSE_APP_Device_Start (struct ca821x_dev *pDeviceRef) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Device_ProcessScanCnf (struct MLME_SCAN_confirm_pset *params, struct ca821x_dev *pDeviceRef) |
Device Process incoming Scan Confirm. More... | |
void | TEMPSENSE_APP_Device_ProcessAssociateCnf (struct MLME_ASSOCIATE_confirm_pset *params, struct ca821x_dev *pDeviceRef) |
Device Process incoming Data Indications. More... | |
void | TEMPSENSE_APP_Device_ProcessDataInd (struct MCPS_DATA_indication_pset *params, struct ca821x_dev *pDeviceRef) |
Device Process incoming Data Indications. More... | |
void | TEMPSENSE_APP_Device_ProcessDataCnf (struct MCPS_DATA_confirm_pset *params, struct ca821x_dev *pDeviceRef) |
Device Process incoming Data Confirms. More... | |
void | TEMPSENSE_APP_Device_ExchangeData (struct ca821x_dev *pDeviceRef) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Device_CheckTimeout (struct ca821x_dev *pDeviceRef) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Device_GoPowerDown (struct ca821x_dev *pDeviceRef) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Device_RestoreStateFromFlash (struct ca821x_dev *pDeviceRef) |
TEMPSENSE App. More... | |
void | TEMPSENSE_APP_Device_SaveStateToFlash (void) |
TEMPSENSE App. More... | |
Variables | |
u8_t | APP_STATE |
module state More... | |
u8_t | APP_STATE_new |
module state set in interrupts More... | |
u8_t | APP_INITIALISE |
flag for re-initialising application More... | |
u8_t | APP_CONNECTED |
sensor module is connected to coordinator More... | |
u16_t | APP_PANId |
u16_t | APP_ShortAddress |
u8_t | APP_LongAddress [8] |
u8_t | APP_Channel |
Chili temperature sensing app declarations.
#define APP_COORD_REPORTN 1 |
report every nth data package
#define APP_COORD_SREINIT 0 |
soft re-initialisation of coordinator
#define APP_CST_ASSOC_REQUESTED 0x09 |
#define APP_CST_C_DATA_CONFIRMED 0x05 |
coord data confirmed (coord)
#define APP_CST_C_DATA_RECEIVED 0x06 |
coord data received (device)
#define APP_CST_C_DATA_REQUESTED 0x04 |
coord data requested (coord)
#define APP_CST_D_DATA_REQUESTED 0x07 |
device data requested (device)
#define APP_CST_DONE 0x00 |
communication completed
#define APP_CST_GO_POWERDOWN 0x08 |
go into powerdown (device)
#define APP_CST_SCANNING 0x0A |
#define APP_CST_WAKEUP_CONFIRMED 0x02 |
wakeup pkt confirmed (device)
#define APP_CST_WAKEUP_RECEIVED 0x03 |
wakeup pkt received (coord)
#define APP_CST_WAKEUP_REQUESTED 0x01 |
wakeup pkt requested (device)
#define APP_DEFAULT_PDN_MODE PDM_DPD |
default powerdown mode for device/sensor
#define APP_DEVICE_MAX_RETRIES 1 |
maximum number of retries for device before disconnection and re-scanning
#define APP_DEVICETIMEOUT 1000 |
device timeout in [ms] for max. time staying awake
#define APP_ED_LIMIT 50 |
energy detect limit (triggers warning)
#define APP_LQI_LIMIT 75 |
link quality limit for joining coordinator
#define APP_MAX_DEVICES 32 |
maximum devices/sensors that can connect to coordinator
#define APP_REPORT_ED 1 |
report ed values (both from device and coordinator)
#define APP_REPORT_LQI 1 |
report lqi values (both from device and coordinator)
#define APP_REPORT_VBATT 1 |
report battery voltage with every reading (otherwise just issue warning if it drops below APP_VBAT_LIMIT)
#define APP_ST_COORDINATOR 1 |
Network Coordinator.
#define APP_ST_DEVICE 2 |
Sensing Device.
#define APP_ST_NORMAL 0 |
Application disabled, EVBME.
#define APP_TIMEOUTINTERVALL 15 |
timeout interval for end devices that havent sent anything for some time [seconds]
#define APP_USE_DEBUG 0 |
use over-air debug mode
#define APP_USE_EXTERNAL_CLOCK 1 |
use clock from cax8210 xtal oscillator (when 1) or nano120 internal RC oscillator as system clock (when 0)
#define APP_VBAT_LIMIT 1862 /* = 2.5 V */ |
battery voltage limit when unplugged (triggers warning)
#define APP_WAKEUPINTERVALL 5 |
wakeup interval for application [seconds]
#define MAC_CHANNELLIST |
#define MAC_LONGADD |
#define MAC_PANID 0xCA5C |
#define MAC_SHORTADD 0xCA00 |
#define PT_MSDU_C_DATA 0x02 |
coordinator data
#define PT_MSDU_D_DATA 0x03 |
device data
#define PT_MSDU_D_WAKEUP 0x01 |
device wakeup indication
void TEMPSENSE_APP_Coordinator_AssociateResponse | ( | struct MLME_ASSOCIATE_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
TEMPSENSE App.
Coordinator Association Response
TEMPSENSE App.
Checks and displays ED from both Sides
ed_ts | - ED received at Temperature Sensor (Device) |
ed_coord | - ED received locally (Coordinator) |
TEMPSENSE App.
Checks and displays LQI from both Sides
lqi_ts | - LQI received at Temperature Sensor (Device) |
lqi_coord | - LQI received locally (Coordinator) |
void TEMPSENSE_APP_Coordinator_CheckTimeouts | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE App.
Coordinator Timeout Check for all Devices
void TEMPSENSE_APP_Coordinator_CheckVbatt | ( | u16_t | vbat | ) |
TEMPSENSE App.
Checks and displays Battery Voltage
vbat | - 12-bit Battery Voltage Reading from Device |
void TEMPSENSE_APP_Coordinator_DisplayData | ( | u8_t | device, |
u8_t | edcoord, | ||
struct MCPS_DATA_indication_pset * | params, | ||
struct ca821x_dev * | pDeviceRef | ||
) |
TEMPSENSE App.
Coordinator check and display Data Packet
device | - device number |
edcoord | - ED received locally (Coordinator) |
params | - Buffer containing data indication with data to display |
pDeviceRef | - Pointer to initialised ca821x_device_ref struct |
void TEMPSENSE_APP_Coordinator_Handler | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE Application Handler for Coordinator.
void TEMPSENSE_APP_Coordinator_Initialise | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE Application Initialisation for Coordinator.
void TEMPSENSE_APP_Coordinator_ProcessDataCnf | ( | struct MCPS_DATA_confirm_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
Coordinator Process incoming Data Confirmations.
void TEMPSENSE_APP_Coordinator_ProcessDataInd | ( | struct MCPS_DATA_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
Coordinator Process incoming Data Indications.
void TEMPSENSE_APP_Coordinator_ProcessScanCnf | ( | struct MLME_SCAN_confirm_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
Coordinator Process incoming Scan Confirm.
void TEMPSENSE_APP_Coordinator_ReportStatus | ( | void | ) |
TEMPSENSE App.
Coordinator Report Network Status
void TEMPSENSE_APP_Coordinator_SoftReinit | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE App.
Coordinator Soft Reset (no change in PIB)
void TEMPSENSE_APP_Coordinator_Start | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE App.
Coordinator Start Procedure
pDeviceRef | - pointer to a CA-821x Device reference struct |
void TEMPSENSE_APP_Device_CheckTimeout | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE App.
Device Timeout Check
void TEMPSENSE_APP_Device_ExchangeData | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE App.
Start exchanging Data with Coordinator
void TEMPSENSE_APP_Device_GetLongAddress | ( | void | ) |
TEMPSENSE Get Device LongAddress from Dataflash.
void TEMPSENSE_APP_Device_GoPowerDown | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE App.
Device prepare and enter sleep mode (and wake-up)
void TEMPSENSE_APP_Device_Handler | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE Application Handler for Sensor Device.
void TEMPSENSE_APP_Device_Initialise | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE Application Initialisation for Sensor Device.
void TEMPSENSE_APP_Device_ProcessAssociateCnf | ( | struct MLME_ASSOCIATE_confirm_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
Device Process incoming Data Indications.
void TEMPSENSE_APP_Device_ProcessDataCnf | ( | struct MCPS_DATA_confirm_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
Device Process incoming Data Confirms.
void TEMPSENSE_APP_Device_ProcessDataInd | ( | struct MCPS_DATA_indication_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
Device Process incoming Data Indications.
void TEMPSENSE_APP_Device_ProcessScanCnf | ( | struct MLME_SCAN_confirm_pset * | params, |
struct ca821x_dev * | pDeviceRef | ||
) |
Device Process incoming Scan Confirm.
void TEMPSENSE_APP_Device_RestoreStateFromFlash | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE App.
Device restore state from flash
void TEMPSENSE_APP_Device_SaveStateToFlash | ( | void | ) |
TEMPSENSE App.
Device save state to flash
void TEMPSENSE_APP_Device_Start | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE App.
Device Association Procedure
u32_t TEMPSENSE_APP_GetScanChannels | ( | void | ) |
TEMPSENSE App.
Get ScanChannels from MAC_CHANNELLIST
u8_t TEMPSENSE_APP_GetTempVal | ( | void | ) |
TEMPSENSE App.
Get Temperature Reading
u16_t TEMPSENSE_APP_GetVoltsVal | ( | void | ) |
TEMPSENSE App.
Get Battery Voltage Reading
void TEMPSENSE_APP_Handler | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE Application Handler.
void TEMPSENSE_APP_Initialise | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE Application Initialisation of MAC etc.
void TEMPSENSE_APP_InitPIB | ( | struct ca821x_dev * | pDeviceRef | ) |
TEMPSENSE Application Initialisation of MAC PIB.
void TEMPSENSE_APP_LED_Handler | ( | void | ) |
module LEDs signalling
void TEMPSENSE_APP_PrintScanChannels | ( | void | ) |
TEMPSENSE App.
Print MAC_CHANNELLIST
void TEMPSENSE_APP_PrintSeconds | ( | void | ) |
Prints AboluteTime in Seconds.
void TEMPSENSE_APP_SwitchMode | ( | u8_t | mode | ) |
TEMPSENSE Switch Mode.
int TEMPSENSE_APP_UpStreamDispatch | ( | struct SerialBuffer * | SerialRxBuffer, |
struct ca821x_dev * | pDeviceRef | ||
) |
TEMPSENSE Dispatch Branch (UpStream, Serial)
|
extern |
|
extern |
sensor module is connected to coordinator
|
extern |
flag for re-initialising application
|
extern |
|
extern |
|
extern |
|
extern |
module state
|
extern |
module state set in interrupts