1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-22 21:23:07 +03:00

add rssi function of new SDK 1.1.0

fix warning in hexdump and ESP8266WiFiMulti
This commit is contained in:
Markus Sattler 2015-05-25 09:46:34 +02:00
parent fb171329f3
commit 5a86c20f1e
5 changed files with 12 additions and 8 deletions

View File

@ -22,10 +22,10 @@
#include "debug.h"
void ICACHE_RAM_ATTR hexdump(uint8_t *mem, uint32_t len, uint8_t cols) {
os_printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", mem, len, len);
os_printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (size_t)mem, len, len);
for(uint32_t i = 0; i < len; i++) {
if(i % cols == 0) {
os_printf("\n[0x%08X] 0x%08X: ", mem, i);
os_printf("\n[0x%08X] 0x%08X: ", (size_t)mem, i);
yield();
}
os_printf("%02X ", *mem);

View File

@ -255,6 +255,11 @@ int32_t ESP8266WiFiClass::channel(void) {
return wifi_get_channel();
}
int32_t ESP8266WiFiClass::RSSI(void) {
return wifi_station_get_rssi();
}
extern "C"
{
typedef STAILQ_HEAD(, bss_info) bss_info_head_t;

View File

@ -163,13 +163,12 @@ public:
int32_t channel(void);
/*
* Return the current network RSSI. Note: this is just a stub, there is no way to
* get the RSSI in the Espressif SDK yet.
* Return the current network RSSI.
*
* return: RSSI value (currently 0)
* return: RSSI value
*/
int32_t RSSI() { return 0; }
int32_t RSSI();
/*
* Start scan WiFi networks available

View File

@ -93,7 +93,7 @@ wl_status_t ESP8266WiFiMulti::run(void) {
DEBUG_WIFI_MULTI(" ");
}
DEBUG_WIFI_MULTI(" %d: [%d][%02X:%02X:%02X:%02X:%02X:%02X] %s (%d) %c\n", i, chan_scan, BSSID_scan[0], BSSID_scan[1], BSSID_scan[2], BSSID_scan[3], BSSID_scan[4], BSSID_scan[5], ssid_scan, rssi_scan, (sec_scan == ENC_TYPE_NONE) ? ' ' : '*');
DEBUG_WIFI_MULTI(" %d: [%d][%02X:%02X:%02X:%02X:%02X:%02X] %s (%d) %c\n", i, chan_scan, BSSID_scan[0], BSSID_scan[1], BSSID_scan[2], BSSID_scan[3], BSSID_scan[4], BSSID_scan[5], ssid_scan.c_str(), rssi_scan, (sec_scan == ENC_TYPE_NONE) ? ' ' : '*');
delay(0);
}
}

View File

@ -32,7 +32,7 @@
#undef max
#include <vector>
//#define DEBUG_WIFI_MULTI(...) os_printf( __VA_ARGS__ )
#define DEBUG_WIFI_MULTI(...) Serial1.printf( __VA_ARGS__ )
#ifndef DEBUG_WIFI_MULTI
#define DEBUG_WIFI_MULTI(...)