Okundu Omeni
/
wifi-https-ble-sm-uart-atcmd-5-13-1
this is using the mbed os version 5-13-1
source/common_config.h@103:7b566b522427, 2019-05-02 (annotated)
- Committer:
- ocomeni
- Date:
- Thu May 02 21:50:17 2019 +0000
- Revision:
- 103:7b566b522427
- Parent:
- 102:9748f290a1a5
- Child:
- 104:11e9605093c9
reached cloud hello message in box comms sequence
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ocomeni | 74:f26e846adfe9 | 1 | #ifndef __COMMON_CONFIG_H__ |
ocomeni | 74:f26e846adfe9 | 2 | #define __COMMON_CONFIG_H__ |
ocomeni | 74:f26e846adfe9 | 3 | |
ocomeni | 74:f26e846adfe9 | 4 | #define DEFAULT_BAUD_RATE 115200 |
ocomeni | 74:f26e846adfe9 | 5 | #define BUFFER_LEN 256 |
ocomeni | 74:f26e846adfe9 | 6 | #define TX_BUFFER_LEN 4*256 |
ocomeni | 74:f26e846adfe9 | 7 | #define RX_BUFFER_LEN 4*256 |
ocomeni | 74:f26e846adfe9 | 8 | #define BTLE_THREAD_PRIORITY osPriorityRealtime |
ocomeni | 88:7ffa053be662 | 9 | #define WIFI_THREAD_PRIORITY osPriorityHigh |
ocomeni | 74:f26e846adfe9 | 10 | #define ATCMD_THREAD_PRIORITY osPriorityRealtime |
ocomeni | 74:f26e846adfe9 | 11 | #ifndef UBLOX_ODIN_W2_RECV_TIMEOUT |
ocomeni | 103:7b566b522427 | 12 | #define UBLOX_ODIN_W2_RECV_TIMEOUT 5 |
ocomeni | 74:f26e846adfe9 | 13 | #endif |
ocomeni | 92:ec9550034276 | 14 | #define USE_MALLOC_FOR_COMMAND_MEMORY_POOL |
ocomeni | 93:06e755a80187 | 15 | #define WIFI_CONNECT_TIMEOUT_SECS 10 |
ocomeni | 95:290859010c8c | 16 | #define MAX_RESPONSE_STRING_LEN 512 // maximum response string length of 512 bytes |
ocomeni | 95:290859010c8c | 17 | #define DEFAULT_WIFI_CHANNEL 0 |
ocomeni | 99:05398b3184f8 | 18 | #define DEFAULT_BTLE_CHANNEL 1 |
ocomeni | 95:290859010c8c | 19 | #define WIFI_LINK_ENABLED "+UUWLE:" |
ocomeni | 99:05398b3184f8 | 20 | #define NETWORK_UP_URC "+UUNU" |
ocomeni | 100:80ef4bc31b7a | 21 | #define PEER_CONNECTED_URC "+UUDPC:" |
ocomeni | 95:290859010c8c | 22 | #define NETWORK_STATUS "+UNSTAT=" |
ocomeni | 95:290859010c8c | 23 | #define WIFI_NETWORK_STATUS "+UWSSTAT=" |
ocomeni | 99:05398b3184f8 | 24 | #define UDDRP_ERROR "\r\nERROR\r\n" |
ocomeni | 99:05398b3184f8 | 25 | #define UDDRP_WRITE_OK "\r\nOK\r\n" |
ocomeni | 99:05398b3184f8 | 26 | #define HOSTNAME_RESPONSE_LEN 14 |
ocomeni | 95:290859010c8c | 27 | #define WIFI_STATION 1 |
ocomeni | 95:290859010c8c | 28 | #define WIFI_CONFIG_ID 0 |
ocomeni | 95:290859010c8c | 29 | #define WIFI_INTERFACE_ID 0 |
ocomeni | 95:290859010c8c | 30 | #define DEFAULT_DNS_ADDRESS "0.0.0.0" |
ocomeni | 99:05398b3184f8 | 31 | #define TCP_PROTOCOL 0 |
ocomeni | 99:05398b3184f8 | 32 | #define UDP_PROTOCOL 1 |
ocomeni | 99:05398b3184f8 | 33 | #define IPv4_CONNECTION 0x02 |
ocomeni | 100:80ef4bc31b7a | 34 | #define IP_PEER_HANDLE 0x02 |
ocomeni | 100:80ef4bc31b7a | 35 | #define BTLE_PEER_HANDLE 0x01 |
ocomeni | 100:80ef4bc31b7a | 36 | #define DEFAULT_LOCAL_PORT 0 |
ocomeni | 87:99b37d26ff2a | 37 | #define PQDSZ 2 // size of Pool/Queue data structures |
ocomeni | 102:9748f290a1a5 | 38 | #define MAX_HTTP_HDR_LEN 512 |
ocomeni | 102:9748f290a1a5 | 39 | #define HTTP_HEADER_START_LINE "HTTP/1.1 " |
ocomeni | 102:9748f290a1a5 | 40 | #define HTTP_HEADER_CONTENT_TYPE "Content-Type:" |
ocomeni | 102:9748f290a1a5 | 41 | #define HTTP_HEADER_CONTENT_LEN "Content-Length:" |
ocomeni | 103:7b566b522427 | 42 | //#define ENABLE_MEMORY_CHECKS |
ocomeni | 95:290859010c8c | 43 | |
ocomeni | 95:290859010c8c | 44 | typedef enum |
ocomeni | 95:290859010c8c | 45 | { |
ocomeni | 95:290859010c8c | 46 | IF_HW_ADDRESS = 0, |
ocomeni | 95:290859010c8c | 47 | NETWORK_IF_STATUS = 1, |
ocomeni | 95:290859010c8c | 48 | INTERFACE_TYPE = 2, |
ocomeni | 95:290859010c8c | 49 | IPv4_ADDRESS = 101, |
ocomeni | 95:290859010c8c | 50 | SUBNET_MASK = 102, |
ocomeni | 95:290859010c8c | 51 | GATEWAY_ADDRESS = 103, |
ocomeni | 95:290859010c8c | 52 | PRIMARY_DNS_SERVER = 104, |
ocomeni | 95:290859010c8c | 53 | SECONDARY_DNS_SERVER = 105, |
ocomeni | 95:290859010c8c | 54 | IPv6_ADDRESS = 201 |
ocomeni | 95:290859010c8c | 55 | }net_stat_id_t; |
ocomeni | 95:290859010c8c | 56 | |
ocomeni | 95:290859010c8c | 57 | typedef enum |
ocomeni | 95:290859010c8c | 58 | { |
ocomeni | 95:290859010c8c | 59 | WIFI_SSID = 0, |
ocomeni | 95:290859010c8c | 60 | WIFI_BSSID = 1, |
ocomeni | 95:290859010c8c | 61 | WIFI__CURRENT_CHANNEL = 2, |
ocomeni | 95:290859010c8c | 62 | WIFI_STA_STATUS = 3, |
ocomeni | 95:290859010c8c | 63 | WIFI_RSSI = 6 |
ocomeni | 95:290859010c8c | 64 | }wifi_stat_id_t; |
ocomeni | 95:290859010c8c | 65 | |
ocomeni | 95:290859010c8c | 66 | const net_stat_id_t netStatusIds[] = {IF_HW_ADDRESS, NETWORK_IF_STATUS, |
ocomeni | 95:290859010c8c | 67 | INTERFACE_TYPE, IPv4_ADDRESS, |
ocomeni | 95:290859010c8c | 68 | SUBNET_MASK, GATEWAY_ADDRESS, |
ocomeni | 95:290859010c8c | 69 | PRIMARY_DNS_SERVER, SECONDARY_DNS_SERVER, |
ocomeni | 95:290859010c8c | 70 | IPv6_ADDRESS}; |
ocomeni | 95:290859010c8c | 71 | |
ocomeni | 95:290859010c8c | 72 | |
ocomeni | 95:290859010c8c | 73 | const int NumNetworkStatus = sizeof(netStatusIds)/sizeof(uint8_t); |
ocomeni | 95:290859010c8c | 74 | |
ocomeni | 95:290859010c8c | 75 | |
ocomeni | 95:290859010c8c | 76 | const wifi_stat_id_t wifiStatusIds[] = {WIFI_SSID, WIFI_BSSID, |
ocomeni | 95:290859010c8c | 77 | WIFI__CURRENT_CHANNEL, WIFI_STA_STATUS, |
ocomeni | 95:290859010c8c | 78 | WIFI_RSSI}; |
ocomeni | 95:290859010c8c | 79 | |
ocomeni | 95:290859010c8c | 80 | const int NumWiFiStatus = sizeof(wifiStatusIds)/sizeof(uint8_t); |
ocomeni | 95:290859010c8c | 81 | |
ocomeni | 83:9c271a50a70b | 82 | const uint8_t hello_msg[] = {0xaa,0x00,0x96,0x00,0x36,0x00,0x50,0x4f |
ocomeni | 83:9c271a50a70b | 83 | ,0x53,0x54,0x20,0x2f,0x6e,0x75,0x64,0x67 |
ocomeni | 83:9c271a50a70b | 84 | ,0x65,0x62,0x6f,0x78,0x2f,0x76,0x31,0x20 |
ocomeni | 83:9c271a50a70b | 85 | ,0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x31 |
ocomeni | 83:9c271a50a70b | 86 | ,0x0d,0x0a,0x48,0x6f,0x73,0x74,0x3a,0x20 |
ocomeni | 83:9c271a50a70b | 87 | ,0x33,0x35,0x2e,0x31,0x37,0x36,0x2e,0x31 |
ocomeni | 83:9c271a50a70b | 88 | ,0x39,0x32,0x2e,0x33,0x33,0x3a,0x38,0x30 |
ocomeni | 83:9c271a50a70b | 89 | ,0x0d,0x0a,0x41,0x63,0x63,0x65,0x70,0x74 |
ocomeni | 83:9c271a50a70b | 90 | ,0x3a,0x20,0x2a,0x2f,0x2a,0x0d,0x0a,0x43 |
ocomeni | 83:9c271a50a70b | 91 | ,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x54 |
ocomeni | 83:9c271a50a70b | 92 | ,0x79,0x70,0x65,0x3a,0x20,0x61,0x70,0x70 |
ocomeni | 83:9c271a50a70b | 93 | ,0x6c,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e |
ocomeni | 83:9c271a50a70b | 94 | ,0x2f,0x6f,0x63,0x74,0x65,0x74,0x2d,0x73 |
ocomeni | 83:9c271a50a70b | 95 | ,0x74,0x72,0x65,0x61,0x6d,0x0d,0x0a,0x43 |
ocomeni | 83:9c271a50a70b | 96 | ,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x4c |
ocomeni | 83:9c271a50a70b | 97 | ,0x65,0x6e,0x67,0x74,0x68,0x3a,0x20,0x32 |
ocomeni | 83:9c271a50a70b | 98 | ,0x30,0x0d,0x0a,0x0d,0x0a,0x00,0x08,0xd4 |
ocomeni | 83:9c271a50a70b | 99 | ,0xca,0x6e,0x79,0x05,0x4e,0x01,0x68,0x65 |
ocomeni | 83:9c271a50a70b | 100 | ,0x6c,0x6c,0x6f,0x00,0x00,0x91,0xb5,0xa4 |
ocomeni | 83:9c271a50a70b | 101 | ,0x10,0x55}; |
ocomeni | 74:f26e846adfe9 | 102 | #endif // __COMMON_CONFIG_H__ |