I am trying to get the WiFi Signal strength of a windows ce device using .net. My device does not support windows zero configuration making things a bit trickier. My application is already using summit sdk which i am trying to use to get the signal strength. Now to use the summit sdk object library file i have a dll (C++) referencing the library file(.lib). And this c++ unmanaged dll (summit.dll) i am calling in my .net code using p invoke.
In my summit.h file i have defined as below :
#ifdef SUMMIT_EXPORTS
#define SUMMIT_API extern "C" __declspec(dllexport)
#else
#define SUMMIT_API __declspec(dllimport)
#endif
SUMMIT_API int SignalStrength(void);
I have added the below code in my summit.cpp class file :
SUMMIT_API int SignalStrength(void)
{
CF10G_STATUS ss;
SDCERR sdcer;
sdcer=GetCurrentStatus(&ss);
return ss.rssi;
}
In above code snippet GetCurrentStatus is function provided by summit declared like below in sdc_sdk.h file
SDCERR GetCurrentStatus(CF10G_STATUS *status);
and in my .net class file i have used pinvoke as below :
[DllImport("summit.dll")]
public static extern int SignalStrength();
and storing the signal strength value as below :
int result=SignalStrength();
But it's not giving me any value. Can anyone help me to understand where i am ging wrong? Is there anything i am missing?