Okundu Omeni
/
wifi-https-ble-sm-uart-atcmd-5-13-1
this is using the mbed os version 5-13-1
Diff: source/WiFiManager.h
- Revision:
- 98:65c2333a38b6
- Parent:
- 95:290859010c8c
- Child:
- 99:05398b3184f8
--- a/source/WiFiManager.h Fri Apr 19 10:26:58 2019 +0000 +++ b/source/WiFiManager.h Sun Apr 21 13:06:41 2019 +0000 @@ -20,6 +20,7 @@ class WiFiManager { public: WiFiManager(wifi_config_t wifi_config, WiFiInterface *wifi, + events::EventQueue &event_queue, MemoryPool<wifi_cmd_message_t, 16> *aT2WiFimPool, Queue<wifi_cmd_message_t, 16> *aT2WiFiCmdQueue, MemoryPool<at_resp_message_t, 16> *wiFi2ATmPool, @@ -31,13 +32,14 @@ ~WiFiManager(); void runMain(); void status_callback(nsapi_event_t status, intptr_t param); - private: Mutex _wmutex; // Protect wifi thread wifi_config_t wifi_config; internet_config_t internet_config; + // define event queue + events::EventQueue &_event_queue; WiFiInterface *network; HttpsRequest* https_request; HttpRequest* http_request; @@ -80,7 +82,7 @@ void set_internet_config(); nsapi_error_t connect(); nsapi_error_t disconnect(); - void createHttpsRequest(); + bool createHttpsRequest(); void createHttpRequest(http_method method, const char* url, Callback<void(const char *at, uint32_t length)> body_callback = 0 @@ -103,10 +105,11 @@ int bufLen); bool createTLSconnection(const char *hostName); void printBufferInHex(uint8_t *buf, int pLen); - void copyResponseHdr2Queue(); + bool copyResponseHdr2Queue(); void sendATresponseString(at_cmd_resp_t); void getNetworkStatus(); void getWiFiStatus(); + void status_callback_event(nsapi_event_t status, intptr_t param); /**