this is using the mbed os version 5-13-1
Diff: source/WiFiManager.h
- Branch:
- PassingRegression
- Revision:
- 119:8d939a902333
- Parent:
- 118:8df0e9c2ee3f
- Child:
- 122:62166886db5f
--- a/source/WiFiManager.h Sat May 25 16:25:42 2019 +0000
+++ b/source/WiFiManager.h Mon May 27 12:34:58 2019 +0000
@@ -15,8 +15,31 @@
*/
#include "https_certificates.h"
#include "common_types.h"
+//const char HELLO_MSG[] =
+
+const uint8_t HELLO_MSG[] = {0x50,0x4f
+ ,0x53,0x54,0x20,0x2f,0x6e,0x75,0x64,0x67
+ ,0x65,0x62,0x6f,0x78,0x2f,0x76,0x31,0x20
+ ,0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x31
+ ,0x0d,0x0a,0x48,0x6f,0x73,0x74,0x3a,0x20
+ ,0x33,0x35,0x2e,0x31,0x37,0x36,0x2e,0x31
+ ,0x39,0x32,0x2e,0x33,0x33,0x3a,0x38,0x30
+ ,0x0d,0x0a,0x41,0x63,0x63,0x65,0x70,0x74
+ ,0x3a,0x20,0x2a,0x2f,0x2a,0x0d,0x0a,0x43
+ ,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x54
+ ,0x79,0x70,0x65,0x3a,0x20,0x61,0x70,0x70
+ ,0x6c,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e
+ ,0x2f,0x6f,0x63,0x74,0x65,0x74,0x2d,0x73
+ ,0x74,0x72,0x65,0x61,0x6d,0x0d,0x0a,0x43
+ ,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x4c
+ ,0x65,0x6e,0x67,0x74,0x68,0x3a,0x20,0x32
+ ,0x30,0x0d,0x0a,0x0d,0x0a,0x00,0x08,0xd4
+ ,0xca,0x6e,0x79,0x05,0x4e,0x01,0x68,0x65
+ ,0x6c,0x6c,0x6f,0x00,0x00,0x91,0xb5,0xa4
+ ,0x10};
extern void print_memory_info();
+#define CLOUD_KEEP_ALIVE_INTERVAL 9000
class WiFiManager {
public:
WiFiManager(wifi_config_t *wifi_config, WiFiInterface *wifi,
@@ -82,6 +105,7 @@
uint32_t watchdogCnt;
http_result_t http_result;
bool use_full_hostname;
+ int keep_alive_id;
#ifdef DNANUDGE_DEBUG
rtos::Semaphore callback_semaphore;
#endif
@@ -135,6 +159,8 @@
void callWifiWatchDogIsr();
void processGetHostByNameResult(nsapi_error_t result, SocketAddress *addr);
bool outputBuffersAvailable();
+ void callInternetKeepAlive();
+ void keepSocketAlive();