summaryrefslogtreecommitdiff
path: root/InfraStack/OSAgnostic/WiMax/Wrappers/Include/wmxSDK_Nds_2.h
diff options
context:
space:
mode:
Diffstat (limited to 'InfraStack/OSAgnostic/WiMax/Wrappers/Include/wmxSDK_Nds_2.h')
-rw-r--r--InfraStack/OSAgnostic/WiMax/Wrappers/Include/wmxSDK_Nds_2.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/InfraStack/OSAgnostic/WiMax/Wrappers/Include/wmxSDK_Nds_2.h b/InfraStack/OSAgnostic/WiMax/Wrappers/Include/wmxSDK_Nds_2.h
index 64ff77f..93f948e 100644
--- a/InfraStack/OSAgnostic/WiMax/Wrappers/Include/wmxSDK_Nds_2.h
+++ b/InfraStack/OSAgnostic/WiMax/Wrappers/Include/wmxSDK_Nds_2.h
@@ -55,12 +55,18 @@ typedef enum _wmx_ConnectionState_t
UnknownConnectionState
}wmx_ConnectionState_t, *wmx_pConnectionState_t;
-static char *ConnectionStateName[] = {
- "ConnectionStateRfOff",
- "Disconnected",
- "OutOfZone",
- "Connected",
- "UnknownConnectionState"
+static inline
+const char * ConnectionStateName(unsigned index)
+{
+ static const char *strs[] = {
+ "ConnectionStateRfOff",
+ "Disconnected",
+ "OutOfZone",
+ "Connected",
+ "UnknownConnectionState"
+ };
+ static const unsigned index_max = sizeof(strs) / sizeof(strs[0]);
+ return index < index_max? strs[index] : "Illegal";
};
/// <summary>
/// The signature defintion of a wmx_pConnectionStateUpdateCB_t callback function.
@@ -147,4 +153,4 @@ wmx_Status_t WMX_WRAPPER_API WMX_EXT_CALL_CONV wmx_RegisterConnectionStateUpdate
/// <returns>A wmx_Status_t value indicating the API call's success/error.</returns>
wmx_Status_t WMX_WRAPPER_API WMX_EXT_CALL_CONV wmx_UnregisterConnectionStateUpdateCB();
-#endif // _WMX_SDK_NDS_2_Hchar \ No newline at end of file
+#endif // _WMX_SDK_NDS_2_Hchar