PANIC
PANIC occurs when TWELITE NET believes that continued system operation is not possible and is reported as a network event.

PANIC structure definition

1
typedef struct {
2
bool_t bCancelReset; //!< Store TRUE to cancel the reset.
3
uint8 u8ReasonCode; //!< Factor code
4
uint32 u32ReasonInfo; //!< Supporting Information for Factors
5
string strReason; //!< String information of factors
6
} tsPanicEventInfo;
Copied!

Reference codes for PANIC processing

1
void cbToCoNet_vNwkEvent(teEvent eEvent, uint32 u32arg) {
2
switch(eEvent) {
3
case E_EVENT_TOCONET_PANIC:
4
if (u32arg) {
5
tsPanicEventInfo *pInfo = (void*)u32arg;
6
V_PRINTF( “PANIC! %d/%s“, pInfo-> u8ReasonCode, pInfo->strReason);
7
pInfo->bCancelReset = TRUE;
8
// If set to TRUE, it will not reset immediately afterwards.
9
// However, the subsequent behaviour is undefined.
10
} break;
11
...
Copied!

ID of the PANIC factor

TOCONET_PANIC_TX_FAIL_COUNT
The transmission process continued to fail within the MAC layer. This is an error that is not normally expected.