void PrintWmxDeviceStatus(wmx_DeviceStatus_t deviceStatus) { switch (deviceStatus) { case DeviceStatus_UnInitialized: PRINT_OUT("Device Status: UnInitialized"); break; case DeviceStatus_RF_OFF_HW_SW: PRINT_OUT("Device Status: HW SW Radio OFF"); break; case DeviceStatus_RF_OFF_HW: PRINT_OUT("Device Status: HW Radio OFF"); break; case DeviceStatus_RF_OFF_SW: PRINT_OUT("Device Status: SW Radio OFF"); break; case DeviceStatus_Ready: PRINT_OUT("Device Status: Ready"); break; case DeviceStatus_Scanning: PRINT_OUT("Device Status: Scanning"); break; case DeviceStatus_Connecting: PRINT_OUT("Device Status: Connecting"); break; case DeviceStatus_Data_Connected: PRINT_OUT("Device Status: Data Connected"); break; default: PRINT_OUT("Device Status: Unknown"); } }
void PrintWmxConnectionProgressInfo(wmx_ConnectionProgressInfo_t connectionProgressInfo) { switch(connectionProgressInfo) { case DeviceConnectionProgress_Ranging: PRINT_OUT("Connection Progress: Ranging"); break; case DeviceConnectionProgress_SBC: PRINT_OUT("Connection Progress: SBC"); break; case DeviceConnectionProgress_EAP_authentication_Device: PRINT_OUT("Connection Progress: EAP Auth (Device)"); break; case DeviceConnectionProgress_EAP_authentication_User: PRINT_OUT("Connection Progress: EAP Auth (User)"); break; case DeviceConnectionProgress_3_way_handshake: PRINT_OUT("Connection Progress: 3 way Handshake"); break; case DeviceConnectionProgress_Registration: PRINT_OUT("Connection Progress: Registration"); break; case DeviceConnectionProgress_De_registration: PRINT_OUT("Connection Progress: De-Registration"); break; case DeviceConnectionProgress_Registered: PRINT_OUT("Connection Progress: Registered"); break; default: PRINT_OUT("Connection Progress: Unknown"); } }
/* * serious stuff is here; not too complex, isn't it? * NB: assumes an ordered delivery service !!! */ void mclget (void) { int len; char buf[BUFLEN]; int received = 0; /* total number of bytes received */ /* open as a sender... */ if ((id = mcl_open("r")) < 0) EXIT(("mclget: mcl_open failed\n")) /* specify a few important parameters... */ if (verbose >= 0) { int stats = 2; /* 2 => all intermediate stats */ mcl_ctl(id, MCL_OPT_VERBOSITY, (void*)&verbose,sizeof(verbose)); mcl_ctl(id, MCL_OPT_STATS, (void*)&stats, sizeof(stats)); } #ifdef ALC if (layers >= 0) mcl_ctl(id, MCL_OPT_LAYER_NB, (void*)&layers, sizeof(layers)); #endif if (port > 0) /* in host format! */ mcl_ctl(id, MCL_OPT_PORT, (void*)&port, sizeof(port)); if (addr > 0) /* in host format! */ mcl_ctl(id, MCL_OPT_ADDR, (void*)&addr, sizeof(addr)); /* get the file content... */ while ((len = mcl_recv(id, buf, BUFLEN)) > 0) { write(fd, buf, len); received += len; PRINT_OUT((stdout, "mclget: %d bytes read, total=%d\n", len, received)) } PRINT_OUT((stdout, "mclget: %d bytes received\n", received)) /* close... */ mcl_close(id); /* ... and that's all folks */ }
void PrintWmxMediaStatus(wmx_MediaStatus_t mediaStatus) { switch(mediaStatus) { case LinkUp: PRINT_OUT("Media Status: Link Up"); break; case LinkDown: PRINT_OUT("Media Status: Link Down"); break; case LinkRenew: PRINT_OUT("Media Status: Link Renew"); break; default: PRINT_OUT("Media Status: Unknown"); break; } }
void PrintWmxConnectProgressInfo( wmx_ConnectProgressInfo_t connectProgressInfo) { switch (connectProgressInfo) { case NotApplicable: PRINT_OUT("Connect Progress Info: Not Applicable"); break; case Ranging: PRINT_OUT("Connect Progress Info: Ranging"); break; case SBC: PRINT_OUT("Connect Progress Info: SBC"); break; case EAPAuthentication: PRINT_OUT("Connect Progress Info: EAP Authenticaton"); break; case ThreeWayHandshake: PRINT_OUT("Connect Progress Info: 3 Way Handshake"); break; case Registration: PRINT_OUT("Connect Progress Info: Registration"); break; default: PRINT_OUT("Connect Progress Info: Unknown"); break; } }
void PrintWmxUserLinkStatus(wmx_UserLinkStatus_t userLinkStatus) { int hour, min, second = 0; PRINT_OUT("RSSI: %d", userLinkStatus.rssi); PRINT_OUT("CINR: %d", userLinkStatus.cinr); PRINT_OUT("Frequency: %d", userLinkStatus.frequency); PRINT_OUT("Power: %d", userLinkStatus.power); PRINT_OUT("Link Quality: %d", userLinkStatus.linkQuality); hour = userLinkStatus.time / 3600; min = ((int)userLinkStatus.time % 3600) / 60; second = (int)userLinkStatus.time % 60; PRINT_OUT("Connection Time: %02d:%02d:%02d", hour, min, second); PRINT_OUT("Up Link Speed: %lf", userLinkStatus.upLinkSpeed); PRINT_OUT("Down Link Speed: %lf", userLinkStatus.downLinkSpeed); PRINT_OUT("BS ID: %c%c%c%c%c%c", userLinkStatus.bsId[0],userLinkStatus.bsId[1],userLinkStatus.bsId[2], userLinkStatus.bsId[3],userLinkStatus.bsId[4],userLinkStatus.bsId[5]); }
void PrintWmxRfSwitchesStatus(wmx_RfSwitchesStatus_t rfSwitchesStatus ) { switch(rfSwitchesStatus.swRfStatus) { case Off: PRINT_OUT("SW Radio: Off"); break; case On: PRINT_OUT("SW Radio: On"); break; default: PRINT_OUT("SW Radio: Unknown"); break; } switch(rfSwitchesStatus.hwRfStatus) { case Off: PRINT_OUT("HW Radio: Off"); break; case On: PRINT_OUT("HW Radio: On"); break; default: PRINT_OUT("HW Radio: Unknown"); break; } }
void PrintWmxStateReason(wmx_StateReason_t stateReason) { switch (stateReason) { case StateReasonNormal: PRINT_OUT("State Reason: Normal"); break; case StateReasonFailToConnectToNW: PRINT_OUT("State Reason: Fail to Connect to Network"); break; case StateReasonFailToConnectRanging: PRINT_OUT("State Reason: Fail to Connect - Ranging"); break; case StateReasonFailToConnectSBC: PRINT_OUT("State Reason: Fail to Connect - SBC"); break; case StateReasonFailToConnectEAPAuth: PRINT_OUT("State Reason: Fail to Connect - EAP Auth"); break; case StateReasonFailToConnect3WayHandshake: PRINT_OUT("State Reason: Fail to Connect - 3 Way Handshake"); break; case StateReasonFailToConnectREG: PRINT_OUT("State Reason: Fail to Connect - Registration"); break; case StateReasonFailToConnectDatapath: PRINT_OUT("State Reason: Fail to Connect - Data Path"); break; case StateReasonFailToConnectCoexNoRF: PRINT_OUT("State Reason: Fail to Connect - Coex No RF"); break; case StateReasonDisconnectDreg: PRINT_OUT("State Reason: Disconnect - DeRegistration"); break; case StateReasonDisconnectAbort: PRINT_OUT("State Reason: Disconnect - Abort"); break; case StateReasonDisconnectReset: PRINT_OUT("State Reason: Disconnect - Reset"); break; case StateReasonDisconnectDrop: PRINT_OUT("State Reason: Disconnect - Drop"); break; case StateReasonSplockValidationFailed: PRINT_OUT("State Reason: SP Lock Validation Fail"); break; case StateReasonDisconnectSecurity: PRINT_OUT("State Reason: Disconnect - Security"); break; case StateReasonResetHwWdt: PRINT_OUT("State Reason: Reset HW WDT"); break; case StateReasonResetSwWdt: PRINT_OUT("State Reason: Reset SW WDT"); break; case StateReasonResetAssert: PRINT_OUT("State Reason: Reset Assert"); break; case StateReasonResetThermal: PRINT_OUT("State Reason: Reset Thermal"); break; case StateReasonResetRfKill: PRINT_OUT("State Reason: Reset RF Kill"); break; case StateReasonResetCoExistence: PRINT_OUT("State Reason: Reset CoExistence"); break; case StateReasonResetHost: PRINT_OUT("State Reason: Reset Host"); break; case StateReasonDisconnectProtocolError: PRINT_OUT("State Reason: Disconnect Protocol Error"); break; case StateReasonFWRequestDevReset: PRINT_OUT("State Reason: FW Request Device Reset"); break; case StateReasonFWRequestFuncReset: PRINT_OUT("State Reason: FW Request Function Reset"); break; default: PRINT_OUT("State Reason: Unknown"); break; } }
void PrintWmxSystemState (wmx_SystemState_t systemState) { switch (systemState) { case UnInitialized: PRINT_OUT("System State: UnInitialized"); break; case Config: PRINT_OUT("System State: Config"); break; case Initialized: PRINT_OUT("System State: Initialized"); break; case Production: PRINT_OUT("System State: Production"); break; case RfOff: PRINT_OUT("System State: Radio Off"); break; case Ready: PRINT_OUT("System State: Ready"); break; case Scan: PRINT_OUT("System State: Scan"); break; case Connecting: PRINT_OUT("System State: Connecting"); break; case WimaxConnected: PRINT_OUT("System State: WiMAX Connected"); break; case DataPathConnected: PRINT_OUT("System State: Data Path Connected"); break; case Idle: PRINT_OUT("System State: Idle"); break; case Disconnecting: PRINT_OUT("System State: Disconnecting"); break; case RfShutDown: PRINT_OUT("System State: Radio Shutdown"); break; case UnknownState: PRINT_OUT("System State: Unknown State"); break; default: PRINT_OUT("System State: Unknown"); break; } }