use TCP to connect to mbed connector
Fork of mbedConnectorInterfaceWithDM by
Diff: mbed-connector-interface/mbedConnectorInterface.h
- Revision:
- 54:dfee8691c83a
- Parent:
- 49:c603a22495bb
- Child:
- 56:3f233795dddf
diff -r d2f9f94b6000 -r dfee8691c83a mbed-connector-interface/mbedConnectorInterface.h --- a/mbed-connector-interface/mbedConnectorInterface.h Mon Aug 08 19:02:00 2016 +0000 +++ b/mbed-connector-interface/mbedConnectorInterface.h Tue Aug 09 17:18:49 2016 +0000 @@ -23,43 +23,68 @@ #ifndef __MBED_CONNECTOR_INTERFACE_H__ #define __MBED_CONNECTOR_INTERFACE_H__ -// Include specific configuration details -#include "mbed-connector-interface/configuration.h" +// mbed +#include "mbed.h" +#include "rtos.h" /************** DEFAULT CONFIGURATION PARAMETERS ************************/ -// mbed-client Configuration -#define REG_UPDATE_PERIOD_MS 25000 // (in ms) - 25 seconds (re-registration update period) -#define OBS_PERIOD_MS 20000 // (in ms) - 20 seconds between observations.. + // Network Selection Definitions + #define ETHERNET 1 + #define WIFI 2 + #define LOWPAN_ND 3 + #define THREAD 4 + + // we will use ThreadedResourceObserver + #define CONNECTOR_USING_THREADS 1 + #define MCI_LWIP_INTERFACE true + #define HAS_EXECUTE_PARAMS true -// mbed-client endpoint lifetime -#define REG_LIFETIME_SEC 600 // Lifetime of the endpoint in seconds + // Default node name + #define NODE_NAME_LENGTH 128 + #define NODE_NAME "mbed-endpoint" + + // Connection URL to mbed Cloud + #if MBED_CONF_APP_NETWORK_INTERFACE == LOWPAN_ND || MBED_CONF_APP_NETWORK_INTERFACE == THREAD + // IPv6 URL Configuration + #define CONNECTOR_URL "coap://2607:f0d0:2601:52::20:5684" + #else + // IPv4 URL Configuration + #define CONNECTOR_URL "coap://api.connector.mbed.com:5684" + #endif + + // Default Endpoint Type specification + #define ENDPOINT_TYPE_LENGTH 128 + #define DEFAULT_ENDPOINT_TYPE "mbed-device" + + // Default Domain used + #define DOMAIN_LENGTH 128 + #define DEFAULT_DOMAIN "domain" + + // Main loop iteration wait time (ms) + #define MAIN_LOOP_WAIT_TIME_MS 1000 + + // mbed-client endpoint lifetime +#define REG_LIFETIME_SEC 100 // Lifetime of the endpoint in seconds + +// default observation period (ms) +#define DEFAULT_OBS_PERIOD 0 // 0 - disabled (manual invocation), otherwise "n" in ms... // Maximum CoAP URL length #define MAX_CONN_URL_LENGTH 128 // Maximum Connection URL length -// 6LowPAN Configuration -#define NODE_MAC_ADDRESS_LENGTH 8 -#define NODE_MAC_ADDRESS {0x00,0x00,0x06,0x02,0x00,0x00,0x36,0x18} -#define NODE_CHANNEL_LIST 0x07FFF800 // All channels - // DynamicResource Configuration #define MAX_VALUE_BUFFER_LENGTH 128 // largest "value" a dynamic resource may assume as a string // Logger buffer size -#define LOGGER_BUFFER_LENGTH 192 // largest single print of a given debug line - -// 802.15.4 Network ID and RF channel defaults -#define MESH_NETWORK_ID_LENGTH 32 -#define MESH_DEF_NETWORK_ID "Network000000000" -#define MESH_DEF_RF_CHANNEL 11 +#define LOGGER_BUFFER_LENGTH 128 // largest single print of a given debug line // WiFi Configuration #define WIFI_SSID_LENGTH 64 #define WIFI_DEFAULT_SSID "changeme" #define WIFI_AUTH_KEY_LENGTH 64 #define WIFI_DEFAULT_AUTH_KEY "changeme" - + /************** DEFAULT CONFIGURATION PARAMETERS ************************/ #endif // __MBED_CONNECTOR_INTERFACE___