use TCP to connect to mbed connector
Fork of mbedConnectorInterfaceWithDM by
mbed-connector-interface/mbedConnectorInterface.h@60:0d9e607dd678, 2016-08-09 (annotated)
- Committer:
- ansond
- Date:
- Tue Aug 09 23:46:16 2016 +0000
- Revision:
- 60:0d9e607dd678
- Parent:
- 59:dd395412bd19
- Child:
- 71:5069a202e892
updated
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ansond | 0:1f1f55e73248 | 1 | /** |
ansond | 0:1f1f55e73248 | 2 | * @file mbedConnectorInterface.h |
ansond | 0:1f1f55e73248 | 3 | * @brief mbed Connector Inteface configuration header file |
ansond | 0:1f1f55e73248 | 4 | * @author Doug Anson |
ansond | 0:1f1f55e73248 | 5 | * @version 1.0 |
ansond | 0:1f1f55e73248 | 6 | * @see |
ansond | 0:1f1f55e73248 | 7 | * |
ansond | 0:1f1f55e73248 | 8 | * Copyright (c) 2014 |
ansond | 0:1f1f55e73248 | 9 | * |
ansond | 0:1f1f55e73248 | 10 | * Licensed under the Apache License, Version 2.0 (the "License"); |
ansond | 0:1f1f55e73248 | 11 | * you may not use this file except in compliance with the License. |
ansond | 0:1f1f55e73248 | 12 | * You may obtain a copy of the License at |
ansond | 0:1f1f55e73248 | 13 | * |
ansond | 0:1f1f55e73248 | 14 | * http://www.apache.org/licenses/LICENSE-2.0 |
ansond | 0:1f1f55e73248 | 15 | * |
ansond | 0:1f1f55e73248 | 16 | * Unless required by applicable law or agreed to in writing, software |
ansond | 0:1f1f55e73248 | 17 | * distributed under the License is distributed on an "AS IS" BASIS, |
ansond | 0:1f1f55e73248 | 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
ansond | 0:1f1f55e73248 | 19 | * See the License for the specific language governing permissions and |
ansond | 0:1f1f55e73248 | 20 | * limitations under the License. |
ansond | 0:1f1f55e73248 | 21 | */ |
ansond | 0:1f1f55e73248 | 22 | |
ansond | 0:1f1f55e73248 | 23 | #ifndef __MBED_CONNECTOR_INTERFACE_H__ |
ansond | 0:1f1f55e73248 | 24 | #define __MBED_CONNECTOR_INTERFACE_H__ |
ansond | 0:1f1f55e73248 | 25 | |
ansond | 54:dfee8691c83a | 26 | // mbed |
ansond | 54:dfee8691c83a | 27 | #include "mbed.h" |
ansond | 54:dfee8691c83a | 28 | #include "rtos.h" |
ansond | 0:1f1f55e73248 | 29 | |
ansond | 0:1f1f55e73248 | 30 | /************** DEFAULT CONFIGURATION PARAMETERS ************************/ |
ansond | 0:1f1f55e73248 | 31 | |
ansond | 54:dfee8691c83a | 32 | // Network Selection Definitions |
ansond | 54:dfee8691c83a | 33 | #define ETHERNET 1 |
ansond | 54:dfee8691c83a | 34 | #define WIFI 2 |
ansond | 56:3f233795dddf | 35 | #define MESH_LOWPAN_ND 3 |
ansond | 56:3f233795dddf | 36 | #define MESH_THREAD 4 |
ansond | 54:dfee8691c83a | 37 | |
ansond | 54:dfee8691c83a | 38 | // we will use ThreadedResourceObserver |
ansond | 54:dfee8691c83a | 39 | #define CONNECTOR_USING_THREADS 1 |
ansond | 54:dfee8691c83a | 40 | #define MCI_LWIP_INTERFACE true |
ansond | 54:dfee8691c83a | 41 | #define HAS_EXECUTE_PARAMS true |
ansond | 0:1f1f55e73248 | 42 | |
ansond | 54:dfee8691c83a | 43 | // Default node name |
ansond | 54:dfee8691c83a | 44 | #define NODE_NAME_LENGTH 128 |
ansond | 54:dfee8691c83a | 45 | #define NODE_NAME "mbed-endpoint" |
ansond | 54:dfee8691c83a | 46 | |
ansond | 54:dfee8691c83a | 47 | // Connection URL to mbed Cloud |
ansond | 57:b017388f1aa3 | 48 | #if MBED_CONF_APP_NETWORK_INTERFACE == MESH_LOWPAN_ND || MBED_CONF_APP_NETWORK_INTERFACE == MESH_THREAD |
ansond | 54:dfee8691c83a | 49 | // IPv6 URL Configuration |
ansond | 59:dd395412bd19 | 50 | #define CONNECTOR_URL "coaps://[2607:f0d0:2601:52::20]:5684" |
ansond | 59:dd395412bd19 | 51 | |
ansond | 59:dd395412bd19 | 52 | // OVERRIDE (until patched in mbed-client) |
ansond | 59:dd395412bd19 | 53 | #define IPV4_OVERRIDE true |
ansond | 54:dfee8691c83a | 54 | #else |
ansond | 54:dfee8691c83a | 55 | // IPv4 URL Configuration |
ansond | 54:dfee8691c83a | 56 | #define CONNECTOR_URL "coap://api.connector.mbed.com:5684" |
ansond | 54:dfee8691c83a | 57 | #endif |
ansond | 54:dfee8691c83a | 58 | |
ansond | 54:dfee8691c83a | 59 | // Default Endpoint Type specification |
ansond | 54:dfee8691c83a | 60 | #define ENDPOINT_TYPE_LENGTH 128 |
ansond | 54:dfee8691c83a | 61 | #define DEFAULT_ENDPOINT_TYPE "mbed-device" |
ansond | 54:dfee8691c83a | 62 | |
ansond | 54:dfee8691c83a | 63 | // Default Domain used |
ansond | 54:dfee8691c83a | 64 | #define DOMAIN_LENGTH 128 |
ansond | 54:dfee8691c83a | 65 | #define DEFAULT_DOMAIN "domain" |
ansond | 54:dfee8691c83a | 66 | |
ansond | 54:dfee8691c83a | 67 | // Main loop iteration wait time (ms) |
ansond | 54:dfee8691c83a | 68 | #define MAIN_LOOP_WAIT_TIME_MS 1000 |
ansond | 54:dfee8691c83a | 69 | |
ansond | 54:dfee8691c83a | 70 | // mbed-client endpoint lifetime |
ansond | 54:dfee8691c83a | 71 | #define REG_LIFETIME_SEC 100 // Lifetime of the endpoint in seconds |
ansond | 54:dfee8691c83a | 72 | |
ansond | 54:dfee8691c83a | 73 | // default observation period (ms) |
ansond | 54:dfee8691c83a | 74 | #define DEFAULT_OBS_PERIOD 0 // 0 - disabled (manual invocation), otherwise "n" in ms... |
ansond | 0:1f1f55e73248 | 75 | |
ansond | 33:1d0b855df5a5 | 76 | // Maximum CoAP URL length |
ansond | 49:c603a22495bb | 77 | #define MAX_CONN_URL_LENGTH 128 // Maximum Connection URL length |
ansond | 0:1f1f55e73248 | 78 | |
ansond | 0:1f1f55e73248 | 79 | // DynamicResource Configuration |
ansond | 49:c603a22495bb | 80 | #define MAX_VALUE_BUFFER_LENGTH 128 // largest "value" a dynamic resource may assume as a string |
ansond | 0:1f1f55e73248 | 81 | |
ansond | 0:1f1f55e73248 | 82 | // Logger buffer size |
ansond | 54:dfee8691c83a | 83 | #define LOGGER_BUFFER_LENGTH 128 // largest single print of a given debug line |
ansond | 0:1f1f55e73248 | 84 | |
ansond | 0:1f1f55e73248 | 85 | // WiFi Configuration |
ansond | 49:c603a22495bb | 86 | #define WIFI_SSID_LENGTH 64 |
ansond | 0:1f1f55e73248 | 87 | #define WIFI_DEFAULT_SSID "changeme" |
ansond | 49:c603a22495bb | 88 | #define WIFI_AUTH_KEY_LENGTH 64 |
ansond | 0:1f1f55e73248 | 89 | #define WIFI_DEFAULT_AUTH_KEY "changeme" |
ansond | 60:0d9e607dd678 | 90 | |
ansond | 60:0d9e607dd678 | 91 | // Default context address string for mbed-client |
ansond | 60:0d9e607dd678 | 92 | #define CONTEXT_ADDRESS_STRING "" |
ansond | 54:dfee8691c83a | 93 | |
ansond | 0:1f1f55e73248 | 94 | /************** DEFAULT CONFIGURATION PARAMETERS ************************/ |
ansond | 0:1f1f55e73248 | 95 | |
ansond | 0:1f1f55e73248 | 96 | #endif // __MBED_CONNECTOR_INTERFACE___ |
ansond | 0:1f1f55e73248 | 97 |