Skip to content

Commit e05a3b8

Browse files
authored
Add a way to return the RSSI value (#934)
See https://forums.raspberrypi.com/viewtopic.php?t=341774
1 parent 9d0b9be commit e05a3b8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

libraries/WiFi/src/WiFiClass.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,13 @@ uint8_t* WiFiClass::BSSID(uint8_t* bssid) {
323323
return: signed value
324324
*/
325325
int32_t WiFiClass::RSSI() {
326-
// TODO - driver does not return this?!
327-
return 0;
326+
#ifndef CYW43_IOCTL_GET_RSSI
327+
#define CYW43_IOCTL_GET_RSSI 0xFE
328+
#endif
329+
330+
int32_t rssi;
331+
cyw43_ioctl(&cyw43_state, CYW43_IOCTL_GET_RSSI, sizeof rssi, (uint8_t *)&rssi, CYW43_ITF_STA);
332+
return rssi;
328333
}
329334

330335
/*

0 commit comments

Comments
 (0)