this is using the mbed os version 5-13-1

Dependencies:   mbed-http

Committer:
ocomeni
Date:
Wed Mar 20 21:02:47 2019 +0000
Revision:
79:a2187bbfa407
Parent:
78:07bb86e3ce14
Child:
80:e8f0e92e3ac9
now have working mechanism for comms between threads using memory pool and queue.; Next stage expand this for data.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ocomeni 78:07bb86e3ce14 1 #ifndef __COMMON_TYPES_H__
ocomeni 78:07bb86e3ce14 2 #define __COMMON_TYPES_H__
ocomeni 78:07bb86e3ce14 3 #include <mbed.h>
ocomeni 79:a2187bbfa407 4 #include "ble/BLE.h"
ocomeni 79:a2187bbfa407 5 #include "SecurityManager.h"
ocomeni 78:07bb86e3ce14 6 #define BLE_MAX_DEVICE_NAME_LEN 10
ocomeni 78:07bb86e3ce14 7 #define MAX_SSID_LEN 32
ocomeni 78:07bb86e3ce14 8 #define MAX_PASSKEY_LEN 32
ocomeni 78:07bb86e3ce14 9
ocomeni 78:07bb86e3ce14 10 /** ble configuration structure
ocomeni 78:07bb86e3ce14 11 */
ocomeni 78:07bb86e3ce14 12 typedef struct ble_config {
ocomeni 79:a2187bbfa407 13 char deviceName[BLE_MAX_DEVICE_NAME_LEN]; /* BLE Device Name */
ocomeni 79:a2187bbfa407 14 uint16_t advInterval; /* advertising interval in msecs */
ocomeni 79:a2187bbfa407 15 uint16_t advTimeout; /* advertising timeout in secs */
ocomeni 79:a2187bbfa407 16 //Passkey_t pairingKey; /* pairing Key */
ocomeni 79:a2187bbfa407 17 uint8_t pairingKey[6]; /* pairing Key */
ocomeni 78:07bb86e3ce14 18 } ble_config_t;
ocomeni 78:07bb86e3ce14 19
ocomeni 78:07bb86e3ce14 20 /** ble configuration structure
ocomeni 78:07bb86e3ce14 21 */
ocomeni 78:07bb86e3ce14 22 typedef struct wifi_config {
ocomeni 78:07bb86e3ce14 23 char ssid[MAX_SSID_LEN]; /* WiFi SSID */
ocomeni 78:07bb86e3ce14 24 char pass[MAX_PASSKEY_LEN]; /* WiFi Passkey */
ocomeni 78:07bb86e3ce14 25 nsapi_security_t security; /* WiFi security */
ocomeni 78:07bb86e3ce14 26 } wifi_config_t;
ocomeni 78:07bb86e3ce14 27
ocomeni 78:07bb86e3ce14 28 /** ble configuration structure
ocomeni 78:07bb86e3ce14 29 */
ocomeni 78:07bb86e3ce14 30 typedef struct app_config {
ocomeni 78:07bb86e3ce14 31 wifi_config_t wifi_config; /* wifi configuration */
ocomeni 78:07bb86e3ce14 32 ble_config_t ble_config; /* ble configuration */
ocomeni 78:07bb86e3ce14 33 } app_config_t;
ocomeni 78:07bb86e3ce14 34
ocomeni 78:07bb86e3ce14 35
ocomeni 79:a2187bbfa407 36 typedef enum wifi_cmd
ocomeni 79:a2187bbfa407 37 {
ocomeni 79:a2187bbfa407 38 WIFI_CMD_NONE,
ocomeni 79:a2187bbfa407 39 WIFI_CMD_SCAN,
ocomeni 79:a2187bbfa407 40 WIFI_CMD_CONNECT,
ocomeni 79:a2187bbfa407 41 WIFI_CMD_DISCONNECT,
ocomeni 79:a2187bbfa407 42 WIFI_CMD_SEND_HTTPS_REQ,
ocomeni 79:a2187bbfa407 43 WIFI_CMD_SEND_HTTP_REQ
ocomeni 79:a2187bbfa407 44 }wifi_cmd_t;
ocomeni 79:a2187bbfa407 45
ocomeni 79:a2187bbfa407 46
ocomeni 79:a2187bbfa407 47 typedef struct {
ocomeni 79:a2187bbfa407 48 wifi_cmd_t wifi_cmd; /* wifi command */
ocomeni 79:a2187bbfa407 49 } wifi_cmd_message_t;
ocomeni 79:a2187bbfa407 50
ocomeni 79:a2187bbfa407 51
ocomeni 78:07bb86e3ce14 52 #endif // __COMMON_TYPES_H__