35 #ifndef TEMPSENSE_APP_H
36 #define TEMPSENSE_APP_H
42 #define APP_WAKEUPINTERVALL 5
44 #define APP_TIMEOUTINTERVALL 15
46 #define APP_DEVICETIMEOUT 1000
48 #define APP_DEVICE_MAX_RETRIES 1
50 #define APP_MAX_DEVICES 32
52 #define APP_DEFAULT_PDN_MODE PDM_DPD
54 #define APP_USE_EXTERNAL_CLOCK 1
56 #define APP_LQI_LIMIT 75
58 #define APP_ED_LIMIT 50
60 #define APP_VBAT_LIMIT 1862
62 #define APP_REPORT_VBATT 1
64 #define APP_REPORT_LQI 1
66 #define APP_REPORT_ED 1
68 #define APP_COORD_REPORTN 1
70 #define APP_COORD_SREINIT 0
72 #define APP_USE_DEBUG 0
77 #define MAC_PANID 0xCA5C
78 #define MAC_SHORTADD 0xCA00
81 0x00, 0x00, 0x00, 0x00, 0xA0, 0x0D, 0x5C, 0xCA \
83 #define MAC_CHANNELLIST \
91 #define APP_ST_NORMAL 0
92 #define APP_ST_COORDINATOR 1
93 #define APP_ST_DEVICE 2
98 #define APP_CST_DONE 0x00
99 #define APP_CST_WAKEUP_REQUESTED 0x01
100 #define APP_CST_WAKEUP_CONFIRMED 0x02
101 #define APP_CST_WAKEUP_RECEIVED 0x03
102 #define APP_CST_C_DATA_REQUESTED 0x04
103 #define APP_CST_C_DATA_CONFIRMED 0x05
104 #define APP_CST_C_DATA_RECEIVED 0x06
105 #define APP_CST_D_DATA_REQUESTED 0x07
106 #define APP_CST_GO_POWERDOWN 0x08
107 #define APP_CST_ASSOC_REQUESTED 0x09
108 #define APP_CST_SCANNING 0x0A
113 #define PT_MSDU_D_WAKEUP 0x01
114 #define PT_MSDU_C_DATA 0x02
115 #define PT_MSDU_D_DATA 0x03
Internal Function definitions for communicating with a host using UART/USB.
struct SerialBuffer SerialRxBuffer
Type definitions used by Cascoda baremetal drivers.
unsigned long u32_t
Definition: cascoda_types.h:50
unsigned char u8_t
Definition: cascoda_types.h:46
unsigned short u16_t
Definition: cascoda_types.h:48
MCPS_DATA_confirm parameter set.
Definition: mac_messages.h:357
MCPS_DATA_indication parameter set.
Definition: mac_messages.h:384
MLME_ASSOCIATE_confirm parameter set.
Definition: mac_messages.h:469
MLME_ASSOCIATE_indication parameter set.
Definition: mac_messages.h:461
MLME_SCAN_confirm parameter set.
Definition: mac_messages.h:507
Structure of serial transfers.
Definition: cascoda_serial.h:50
CA-821x Device reference struct.
Definition: ca821x_api.h:123
void TEMPSENSE_APP_Device_GoPowerDown(struct ca821x_dev *pDeviceRef)
TEMPSENSE App.
Definition: tempsense_app_device.c:522
void TEMPSENSE_APP_Device_ProcessAssociateCnf(struct MLME_ASSOCIATE_confirm_pset *params, struct ca821x_dev *pDeviceRef)
Device Process incoming Data Indications.
Definition: tempsense_app_device.c:240
void TEMPSENSE_APP_Coordinator_DisplayData(u8_t device, u8_t edcoord, struct MCPS_DATA_indication_pset *params, struct ca821x_dev *pDeviceRef)
TEMPSENSE App.
Definition: tempsense_app_coord.c:543
void TEMPSENSE_APP_Device_Initialise(struct ca821x_dev *pDeviceRef)
TEMPSENSE Application Initialisation for Sensor Device.
Definition: tempsense_app_device.c:87
void TEMPSENSE_APP_Device_ExchangeData(struct ca821x_dev *pDeviceRef)
TEMPSENSE App.
Definition: tempsense_app_device.c:425
u8_t TEMPSENSE_APP_GetTempVal(void)
TEMPSENSE App.
Definition: tempsense_app.c:214
void TEMPSENSE_APP_Coordinator_SoftReinit(struct ca821x_dev *pDeviceRef)
TEMPSENSE App.
Definition: tempsense_app_coord.c:705
void TEMPSENSE_APP_Device_ProcessDataCnf(struct MCPS_DATA_confirm_pset *params, struct ca821x_dev *pDeviceRef)
Device Process incoming Data Confirms.
Definition: tempsense_app_device.c:375
void TEMPSENSE_APP_Coordinator_ProcessDataInd(struct MCPS_DATA_indication_pset *params, struct ca821x_dev *pDeviceRef)
Coordinator Process incoming Data Indications.
Definition: tempsense_app_coord.c:312
u16_t TEMPSENSE_APP_GetVoltsVal(void)
TEMPSENSE App.
Definition: tempsense_app.c:228
void TEMPSENSE_APP_Device_SaveStateToFlash(void)
TEMPSENSE App.
Definition: tempsense_app_device.c:600
void TEMPSENSE_APP_Device_ProcessDataInd(struct MCPS_DATA_indication_pset *params, struct ca821x_dev *pDeviceRef)
Device Process incoming Data Indications.
Definition: tempsense_app_device.c:269
u8_t APP_STATE
module state
Definition: tempsense_app.c:54
void TEMPSENSE_APP_Coordinator_Start(struct ca821x_dev *pDeviceRef)
TEMPSENSE App.
Definition: tempsense_app_coord.c:103
void TEMPSENSE_APP_Device_Start(struct ca821x_dev *pDeviceRef)
TEMPSENSE App.
Definition: tempsense_app_device.c:127
void TEMPSENSE_APP_Device_ProcessScanCnf(struct MLME_SCAN_confirm_pset *params, struct ca821x_dev *pDeviceRef)
Device Process incoming Scan Confirm.
Definition: tempsense_app_device.c:155
u8_t APP_STATE_new
module state set in interrupts
Definition: tempsense_app.c:55
u8_t APP_LongAddress[8]
Definition: tempsense_app.c:62
void TEMPSENSE_APP_Coordinator_CheckTimeouts(struct ca821x_dev *pDeviceRef)
TEMPSENSE App.
Definition: tempsense_app_coord.c:597
void TEMPSENSE_APP_LED_Handler(void)
module LEDs signalling
Definition: tempsense_app.c:284
void TEMPSENSE_APP_Coordinator_ProcessScanCnf(struct MLME_SCAN_confirm_pset *params, struct ca821x_dev *pDeviceRef)
Coordinator Process incoming Scan Confirm.
Definition: tempsense_app_coord.c:128
void TEMPSENSE_APP_Coordinator_ProcessDataCnf(struct MCPS_DATA_confirm_pset *params, struct ca821x_dev *pDeviceRef)
Coordinator Process incoming Data Confirmations.
Definition: tempsense_app_coord.c:508
void TEMPSENSE_APP_Coordinator_CheckLQI(u8_t lqi_ts, u8_t lqi_coord)
TEMPSENSE App.
Definition: tempsense_app_coord.c:675
u16_t APP_ShortAddress
Definition: tempsense_app.c:61
void TEMPSENSE_APP_Coordinator_Handler(struct ca821x_dev *pDeviceRef)
TEMPSENSE Application Handler for Coordinator.
Definition: tempsense_app_coord.c:64
void TEMPSENSE_APP_SwitchMode(u8_t mode)
TEMPSENSE Switch Mode.
Definition: tempsense_app.c:151
void TEMPSENSE_APP_Coordinator_CheckED(u8_t ed_ts, u8_t ed_coord)
TEMPSENSE App.
Definition: tempsense_app_coord.c:690
void TEMPSENSE_APP_Device_RestoreStateFromFlash(struct ca821x_dev *pDeviceRef)
TEMPSENSE App.
Definition: tempsense_app_device.c:647
void TEMPSENSE_APP_Initialise(struct ca821x_dev *pDeviceRef)
TEMPSENSE Application Initialisation of MAC etc.
Definition: tempsense_app.c:89
void TEMPSENSE_APP_Coordinator_ReportStatus(void)
TEMPSENSE App.
Definition: tempsense_app_coord.c:737
u8_t APP_INITIALISE
flag for re-initialising application
Definition: tempsense_app.c:56
void TEMPSENSE_APP_Coordinator_AssociateResponse(struct MLME_ASSOCIATE_indication_pset *params, struct ca821x_dev *pDeviceRef)
TEMPSENSE App.
Definition: tempsense_app_coord.c:205
u32_t TEMPSENSE_APP_GetScanChannels(void)
TEMPSENSE App.
Definition: tempsense_app.c:239
void TEMPSENSE_APP_Device_CheckTimeout(struct ca821x_dev *pDeviceRef)
TEMPSENSE App.
Definition: tempsense_app_device.c:496
int TEMPSENSE_APP_UpStreamDispatch(struct SerialBuffer *SerialRxBuffer, struct ca821x_dev *pDeviceRef)
TEMPSENSE Dispatch Branch (UpStream, Serial)
Definition: tempsense_app.c:136
void TEMPSENSE_APP_Handler(struct ca821x_dev *pDeviceRef)
TEMPSENSE Application Handler.
Definition: tempsense_app.c:65
u8_t APP_Channel
Definition: tempsense_app.c:63
u8_t APP_CONNECTED
sensor module is connected to coordinator
Definition: tempsense_app.c:57
void TEMPSENSE_APP_Device_Handler(struct ca821x_dev *pDeviceRef)
TEMPSENSE Application Handler for Sensor Device.
Definition: tempsense_app_device.c:65
void TEMPSENSE_APP_Coordinator_Initialise(struct ca821x_dev *pDeviceRef)
TEMPSENSE Application Initialisation for Coordinator.
Definition: tempsense_app_coord.c:75
void TEMPSENSE_APP_InitPIB(struct ca821x_dev *pDeviceRef)
TEMPSENSE Application Initialisation of MAC PIB.
Definition: tempsense_app.c:166
void TEMPSENSE_APP_Coordinator_CheckVbatt(u16_t vbat)
TEMPSENSE App.
Definition: tempsense_app_coord.c:658
void TEMPSENSE_APP_PrintSeconds(void)
Prints AboluteTime in Seconds.
Definition: tempsense_app.c:279
void TEMPSENSE_APP_Device_GetLongAddress(void)
TEMPSENSE Get Device LongAddress from Dataflash.
Definition: tempsense_app_device.c:115
u16_t APP_PANId
Definition: tempsense_app.c:60
void TEMPSENSE_APP_PrintScanChannels(void)
TEMPSENSE App.
Definition: tempsense_app.c:261