Sample program showing how to connect GR-PEACH into Watson IoT through mbed Connector and Watson's Connector Bridge

Dependencies:   AsciiFont DisplayApp GR-PEACH_video LCD_shield_config LWIPBP3595Interface_STA_for_mbed-os USBDevice

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 /************** DEFAULT CONFIGURATION PARAMETERS  ************************/
00031 
00032  // Network Selection Definitions
00033  #define ETHERNET                           1
00034  #define WIFI                               2
00035  #define MESH_LOWPAN_ND                     3
00036  #define MESH_THREAD                        4
00037 
00038  // we will use ThreadedResourceObserver
00039  #define CONNECTOR_USING_THREADS            1
00040  #define MCI_LWIP_INTERFACE                 true
00041  #define HAS_EXECUTE_PARAMS                 true
00042 
00043  // Default node name
00044  #define NODE_NAME_LENGTH                   128
00045  #define NODE_NAME                          "mbed-endpoint"
00046  
00047  // Connection URL to mbed Cloud
00048  #if MBED_CONF_APP_NETWORK_INTERFACE == MESH_LOWPAN_ND || MBED_CONF_APP_NETWORK_INTERFACE == MESH_THREAD
00049     // IPv6 URL Configuration
00050     #define CONNECTOR_URL                   "coaps://[2607:f0d0:2601:52::20]:5684"
00051     
00052     // OVERRIDE (until patched in mbed-client)
00053     #define IPV4_OVERRIDE                   true 
00054  #else
00055     // IPv4 URL Configuration
00056     #define CONNECTOR_URL                   "coap://api.connector.mbed.com:5684"
00057  #endif
00058   
00059  // Default Endpoint Type specification
00060  #define ENDPOINT_TYPE_LENGTH               128
00061  #define DEFAULT_ENDPOINT_TYPE              "mbed-device"
00062  
00063  // Default Domain used
00064  #define DOMAIN_LENGTH                      128
00065  #define DEFAULT_DOMAIN                     "domain"
00066  
00067  // Main loop iteration wait time (ms)
00068  #define MAIN_LOOP_WAIT_TIME_MS             1000
00069  
00070  // mbed-client endpoint lifetime
00071 #define REG_LIFETIME_SEC                    100                                         // Lifetime of the endpoint in seconds
00072 
00073 // default observation period (ms)
00074 #define DEFAULT_OBS_PERIOD                  0                                           // 0 - disabled (manual invocation), otherwise "n" in ms...
00075 
00076 // Maximum CoAP URL length
00077 #define MAX_CONN_URL_LENGTH                 128                                         // Maximum Connection URL length
00078 
00079 // DynamicResource Configuration
00080 #define MAX_VALUE_BUFFER_LENGTH             128                                         // largest "value" a dynamic resource may assume as a string
00081 
00082 // Logger buffer size
00083 #define LOGGER_BUFFER_LENGTH                128                                         // largest single print of a given debug line
00084 
00085 // WiFi Configuration
00086 #define WIFI_SSID_LENGTH                    64
00087 #define WIFI_DEFAULT_SSID                   "changeme"
00088 #define WIFI_AUTH_KEY_LENGTH                64
00089 #define WIFI_DEFAULT_AUTH_KEY               "changeme"
00090 
00091 // Default context address string for mbed-client
00092 #define CONTEXT_ADDRESS_STRING              ""
00093  
00094 /************** DEFAULT CONFIGURATION PARAMETERS  ************************/
00095 
00096 #endif // __MBED_CONNECTOR_INTERFACE___
00097