void WF_OutputConnectionDebugMsg(uint8_t event, uint16_t eventInfo) { if (event == WF_EVENT_CONNECTION_TEMPORARILY_LOST) { OutputConnectionTempLostMsg(eventInfo); } else if (event == WF_EVENT_CONNECTION_FAILED) { OutputConnectionFailedMsg(eventInfo); } else if (event == WF_EVENT_CONNECTION_PERMANENTLY_LOST) { OutputConnectionPermLostMsg(eventInfo); } }
void WF_OutputConnectionContext(void) { tWFConnectContext context; int i; char buf[6]; #if defined(EZ_CONFIG_STORE) if (AppConfig.networkType == WF_INFRASTRUCTURE) { #else if (TRUE) { #endif WF_CMGetConnectContext(&context); putrsUART("\tbssid: "); for (i = 0; i < 6; ++i) { if (i < 5) { sprintf(buf, "%02X:", context.bssid[i]); putsUART(buf); } else { sprintf(buf, "%02X\r\n", context.bssid[i]); putsUART(buf); } } putrsUART("\tchannel: "); sprintf(buf, "%d\r\n", context.channel); putsUART(buf); } } #endif /* MRF24WG */ void WF_OutputConnectionDebugMsg(UINT8 event, UINT16 eventInfo) { if (event == WF_EVENT_CONNECTION_TEMPORARILY_LOST) { OutputConnectionTempLostMsg(eventInfo); } else if (event == WF_EVENT_CONNECTION_FAILED) { OutputConnectionFailedMsg(eventInfo); } else if (event == WF_EVENT_CONNECTION_PERMANENTLY_LOST) { OutputConnectionPermLostMsg(eventInfo); } } static void OutputConnectionTempLostMsg(UINT16 eventInfo) { char buf[8]; #if defined(MRF24WG) if (eventInfo & WF_MASK_DEAUTH_REASONCODE) { putrsUART("Event: Connection Temporarily Lost -- eventInfo = Received deauth : "); #if !defined(__18CXX) putrsUART(deauthDisssocReasonCodes[eventInfo & ~WF_MASK_DEAUTH_REASONCODE]); #endif } else if (eventInfo & WF_MASK_DISASSOC_REASONCODE) { putrsUART("Event: Connection Temporarily Lost -- eventInfo = Received disassoc : "); #if !defined(__18CXX) putrsUART(deauthDisssocReasonCodes[eventInfo & ~WF_MASK_DISASSOC_REASONCODE]); #endif } else { putrsUART("Event: Connection Temporarily Lost -- eventInfo = "); sprintf(buf, "%d, ", eventInfo); putsUART(buf); putrsUART(connectionLostStrings[eventInfo]); } #else /* !defined(MRF24WG) */ putrsUART("Event: Connection Temporarily Lost -- eventInfo = "); sprintf(buf, "%d, ", eventInfo); putsUART(buf); putrsUART(connectionLostStrings[eventInfo]); #endif /* defined(MRF24WG) */ putrsUART("\r\n"); }