请教大神们,我用的模块是WG1300-B0.数据可以收发,由于项目需要读取WIFI信号强度。知道的大神们,请告知。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
是通过这个API来做的wlan_ioctl_get_scan_results,你看它返回的结果里面有一项是rssi。
加一个下面的结构体:
typedef struct {
unsigned long networksFound;
unsigned long scanStatus;
unsigned long isValid : 1;
signed long rssi : 7;
unsigned long securityMode : 2;
unsigned long ulSsidLen : 6;
unsigned long frameTime : 16;
char ssid[32];
unsigned char ucBssid[6];
} wifi_scan_result_t;
然后代码片段如下:
static unsigned char buffer[50];
wifi_scan_result_t *result = (wifi_scan_result_t *) buffer;
memset(buffer, 0, sizeof(buffer));
if (wlan_ioctl_get_scan_results(0, buffer) != 0)
{
return -2;
}