Skip to content

Commit

Permalink
Icon if AP is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
lupus78 committed Jun 6, 2021
1 parent ac29472 commit bbe864d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main/disp_oled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#include "wifi.h"
#endif

#ifdef WITH_AP
#include "wifi.h"
#endif

#ifdef WITH_BT_SPP
#include "bt.h"
#endif
Expand Down Expand Up @@ -592,6 +596,11 @@ void OLED_DrawStatusBar(u8g2_t *OLED, GPS_Position *GPS) // status bar on top
if(WIFI_isConnected())
{ u8g2_SetFont(OLED, u8g2_font_open_iconic_all_1x_t);
u8g2_DrawGlyph(OLED, 43, 11, 0x119); } // 0x50
#endif
#ifdef WITH_AP
if(WIFI_isAP())
{ u8g2_SetFont(OLED, u8g2_font_open_iconic_all_1x_t);
u8g2_DrawGlyph(OLED, 43, 11, 0xF8); } // 0x50
#endif
// u8g2_SetFont(OLED, u8g2_font_5x7_tr);
// u8g2_SetFont(OLED, u8g2_font_5x8_tr);
Expand Down
1 change: 1 addition & 0 deletions main/wifi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tcpip_adapter_ip_info_t WIFI_IP = { 0, 0, 0 }; // WIFI local IP address, mask a
WIFI_State_t WIFI_State;

bool WIFI_isConnected(void) { return WIFI_IP.ip.addr!=0; } // return "connected" status when IP from DHCP is there
bool WIFI_isAP(void) { return WIFI_Config.ap.ssid_len!=0; } // return if AP mode enabled

static esp_err_t WIFI_event_handler(void *ctx, system_event_t *event)
{
Expand Down
1 change: 1 addition & 0 deletions main/wifi.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ typedef union
extern WIFI_State_t WIFI_State;

bool WIFI_isConnected(void);
bool WIFI_isAP(void);
esp_err_t WIFI_Init(void);
esp_err_t WIFI_setPowerSave(bool ON);
esp_err_t WIFI_Start(void);
Expand Down

0 comments on commit bbe864d

Please sign in to comment.