Doug Anson / mbedConnectorInterfaceWithDM

Fork of mbedConnectorInterfaceV3 by Doug Anson

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mbedConnectorInterface.h Source File

mbedConnectorInterface.h

Go to the documentation of this file.
00001 /**
00002  * @file    mbedConnectorInterface.h
00003  * @brief   mbed Connector Inteface configuration header file
00004  * @author  Doug Anson
00005  * @version 1.0
00006  * @see
00007  *
00008  * Copyright (c) 2014
00009  *
00010  * Licensed under the Apache License, Version 2.0 (the "License");
00011  * you may not use this file except in compliance with the License.
00012  * You may obtain a copy of the License at
00013  *
00014  *     http://www.apache.org/licenses/LICENSE-2.0
00015  *
00016  * Unless required by applicable law or agreed to in writing, software
00017  * distributed under the License is distributed on an "AS IS" BASIS,
00018  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00019  * See the License for the specific language governing permissions and
00020  * limitations under the License.
00021  */
00022 
00023 #ifndef __MBED_CONNECTOR_INTERFACE_H__
00024 #define __MBED_CONNECTOR_INTERFACE_H__
00025 
00026 // mbed
00027 #include "mbed.h"
00028 #include "rtos.h"
00029 
00030 // Enable/Disable mbed Cloud support
00031 #include "security.h"
00032 
00033 /************** DEFAULT CONFIGURATION PARAMETERS  ************************/
00034 
00035 // Network Selection Definitions (must match easy-connect.h)
00036 #define ETHERNET                            1
00037 #define WIFI_ESP8266                        2
00038 #define MESH_LOWPAN_ND                      3
00039 #define MESH_THREAD                         4
00040 #define WIFI_ODIN                           5
00041 
00042 //
00043 // ResourceObserver type: EventQueue, Threading, or Ticker (only ONE may be uncommented)
00044 //
00045 //#define CONNECTOR_USING_EVENT_QUEUES  1   // currently broken... please do not use
00046 #define CONNECTOR_USING_THREADS         1   // Threads used
00047 //#define CONNECTOR_USING_TICKER        1   // Tickers - resource's get() method called from within ISR!!! 
00048 
00049 // mbedOS5 uses LWIP
00050 #define MCI_LWIP_INTERFACE                  true
00051 
00052 // mbed-client utilizes execute parameters
00053 #define HAS_EXECUTE_PARAMS                  true
00054 
00055 // Default node name
00056 #define NODE_NAME_LENGTH                    128
00057 #define NODE_NAME                           "mbed-endpoint"
00058  
00059 // Connection URL to mbed Connector (not used for R1.2+ mbed Cloud)
00060 #if MBED_CONF_APP_NETWORK_INTERFACE == MESH_LOWPAN_ND || MBED_CONF_APP_NETWORK_INTERFACE == MESH_THREAD
00061     // IPv6 URL Configuration
00062     #define CONNECTOR_URL                   "coaps://[2607:f0d0:2601:52::20]:5684"
00063     
00064     // OVERRIDE (until patched in mbed-client)
00065     #define IPV4_OVERRIDE                   true 
00066 #else
00067     // IPv4 URL Configuration
00068     #define CONNECTOR_URL                   "coap://api.connector.mbed.com:5684"
00069 #endif
00070   
00071 // Default Endpoint Type specification
00072 #define ENDPOINT_TYPE_LENGTH                128
00073 #define DEFAULT_ENDPOINT_TYPE               "mbed-device"
00074  
00075 // Default Domain used
00076 #define DOMAIN_LENGTH                       128
00077 #define DEFAULT_DOMAIN                      "domain"
00078  
00079 // Main loop iteration wait time (ms)
00080 #define MAIN_LOOP_WAIT_TIME_MS              1000
00081  
00082 // mbed-client endpoint lifetime
00083 #define REG_LIFETIME_SEC                    100                                         // Lifetime of the endpoint in seconds
00084 
00085 // default observation period (ms)
00086 #define DEFAULT_OBS_PERIOD                  0                                           // 0 - disabled (manual invocation), otherwise "n" in ms...
00087 
00088 // Maximum CoAP URL length
00089 #define MAX_CONN_URL_LENGTH                 128                                         // Maximum Connection URL length
00090 
00091 // DynamicResource Configuration
00092 #define MAX_VALUE_BUFFER_LENGTH             1024                                        // largest "value" a dynamic resource may assume as a string (max CoAP packet length)
00093 
00094 // Logger buffer size
00095 #define LOGGER_BUFFER_LENGTH                128                                         // largest single print of a given debug line
00096 
00097 // WiFi Configuration
00098 #define WIFI_SSID_LENGTH                    64
00099 #define WIFI_DEFAULT_SSID                   "changeme"
00100 #define WIFI_AUTH_KEY_LENGTH                64
00101 #define WIFI_DEFAULT_AUTH_KEY               "changeme"
00102 
00103 // Default context address string for mbed-client
00104 #define CONTEXT_ADDRESS_STRING              ""
00105 
00106 // Uncomment (and implement) for Update authorization and progress handlers
00107 //#define ENABLE_UPDATE_AUTHORIZE_HANDLER       true    // MUST go into ConnectorEndpoint.cpp and implement... otherwise, update request will not get serviced.
00108 //#define ENALBE_UPDATE_PROGRESS_HANDLER        true
00109  
00110 /************** DEFAULT CONFIGURATION PARAMETERS  ************************/
00111 
00112 #endif // __MBED_CONNECTOR_INTERFACE___
00113