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
Overview
This sample program shows how to connect GR-PEACH into Watson IoT through mbed Connector and Watson's Connector Bridge. Note that this program is derived from https://github.com/ARMmbed/mbed-ethernet-sample-techcon2016.
In this program, at first, the barcode data input from camera is decoded on GR-PEACH using ZXing which is an open-source, multi-format 1D/2D barcode image processing library. Then, the decoded string is sent to Watson IoT via mbed Device Connector and Watson's Connector Bridge. At last, the delivered string is confirmed via NodeRED flow.
Required hardware
- GR-PEACH ( https://developer.mbed.org/platforms/Renesas-GR-PEACH/ )
- Audio Camera Shield ( https://developer.mbed.org/teams/Renesas/wiki/Audio_Camera-shield )
- LCD Shield ( https://developer.mbed.org/teams/Renesas/wiki/LCD-shield )
- BP3595 ( https://developer.mbed.org/components/BP3595-for-GR-PEACH/ )
- Ethernet cable and connection to the internet
Application setup
- Select the connection type. For details, please refer to the following wiki:
https://developer.mbed.org/teams/Renesas/code/mbed-os_Watson-IoT_ZXing_sample/wiki/Connection-type. - Set the client credentials. For details, please refer to the following wiki:
https://developer.mbed.org/teams/Renesas/code/mbed-os_Watson-IoT_ZXing_sample/wiki/Client-credentials. - Change Ethernet settings. For details, please refer to the following wiki:
https://developer.mbed.org/teams/Renesas/code/mbed-os_Watson-IoT_ZXing_sample/wiki/Ethernet-settings. - Change Wifi settings. For details, please refer to the following wiki:
https://developer.mbed.org/teams/Renesas/code/mbed-os_Watson-IoT_ZXing_sample/wiki/Wifi-settings.
Building this sample program
- Import this sample program onto mbed Compiler.
- Configure this sample program in accordance with Application setup.
- Compile the example on mbed Compiler and download the resultant binary file.
- Plug the Ethernet cable into GR-PEACH if you are using Ethernet mode.
- Plug the micro-USB cable into the OpenSDA port with lies on the next to the RESET button.
- Copy the binary previously downloaded to your PC to GR-PEACH to flash this sample program. When the copy is successfully completed, the board is ready to work.
- Press the RESET button on the board to run this sample program.
- For verification, please refer to the following wiki:
https://developer.mbed.org/teams/Renesas/code/mbed-os_Watson-IoT_ZXing_sample/wiki/Monitoring-the-application.
Application resources
This sample program exposes two resources listed below:
- /311/0/5850 : Trigger to toggle LED on GR-PEACH (PUT). When "1" is sent to this resource by PUT method, LED should be turned off. Otherwise, LED should be turned on.
- /888/0/7700: Decode result of barcode data input from camera (GET)
Setup of Watson IoT
- You should create Watson IoT Instance by the following procedure:
- Login IBM Bluemix from https://console.ng.bluemix.net/ and login it.
- Select Services as follows:
- Select Internet of Things" as follows:
- Press Get Started as follows:
- Configure Watson IoT Instance
- Leave unbound
- Select the Free plan, then click Create
- You should create Watson IoT Application Credentials
Once you successfully create Watson IoT Instance, you should see the following Watson IoT dashboard:
- On dashboard, launch the Connect your devices dashboard
- Click APPS
- Click Generate API Key
- Record the API Key and Authenticatoin Token. Then click Generate after adding a comment Note that these two values will be needed in the later step.
- Watson IoT NodeRED Application should be created in accordance with the following procedure:
- Go back to your Bluemix Dashboard: https://console.ng.bluemix.net
- Click Create Application
- Select Node-RED Starter
- Enter a unique App name and Click Create
- Application will Stage after a few minutes
- Application will report app is running when the staging has completed
- Watson NodeRED Application should be binded to Watson IoT instance
- You can now see the dashboard below:
- Click Connections. Then, press Connect Existing
- Click on Watson IoT Instance badge. Then, press Connect
- NodeRED application will restage. This will take a while. Please wait for Your app is running state
- You should acquire mbed Device Connector DOMAIN value
- Go to the mbed Device Connector Dashboard: https://connector.mbed.com and log in
- Select Access Key in order to create a new token
- Click CREATE NEW ACCESS KEY and enter a unique name. Then, push ADD bution
- an API token is generated. Need to save the generated string for later steps
- You should configure Watson IoT ARM mbed Connector Bridge
- Go back to the Watson IoT Dashboard and select Extensions
- Press Add Extension
- Add ARM mbed Connector
- Setup the bridge
- Enter your Connector API Token to Access Key and MBED_DOMAIN to Domain Id, respectively. Then, click Check Connection
- If the connection is successfully established, you can see Connection Established. Then, press Done
- NodeRED Flow Example should be imported
- Open NODEFLOW_GR-PEACH.txt
- Navigate to the URL that you recorded earlier for your Watson IoT NodeRED Application (i.e. http://<app name>.mybluemix.net) and Select Go to your NodeRED flow editor
- Select menu, Import and Clipboard
- Paste the entire contents of JSON code described in NODEFLOW_GR-PEACH.txt and click Import
- Watson IoT Application Node Flow should be configured
- Double-click input node and link them to your Watson IoT instance.
- Click on the edit button
- First enter arbitrary name. Then, Watson API Key and Watson Auth Token previously acquired. Finally, press Add to save
- Enter MBED_ENDPOINT_NAME in security.h as Device ID. Then, press Done to save
- Double-click output node
- Edit API Key and Device Id in the same manner as that for input node
- Click LED OFF and LED ON node and replace MBED_ENDPOINT_NAME_GOES_HERE with MBED_ENDPOINT_NAME as shown below:
- Click Deproy to deploy NodeRED application
- Invoke sample program
- Press the reset button on GR-PEACH
- The decode result of barcode data should be shown in debug window
- Also, you can toggle LED by clicking Turn LED OFF and Turn LED ON injection node
mbedConnectorInterface/mbed-connector-interface/Options.h@0:ad834d403a8c, 2016-11-24 (annotated)
- Committer:
- Osamu Nakamura
- Date:
- Thu Nov 24 13:59:16 2016 +0900
- Revision:
- 0:ad834d403a8c
Initial Commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Osamu Nakamura |
0:ad834d403a8c | 1 | /** |
Osamu Nakamura |
0:ad834d403a8c | 2 | * @file Options.h |
Osamu Nakamura |
0:ad834d403a8c | 3 | * @brief mbed CoAP Options (immutable OptionsBuilder instance) class header |
Osamu Nakamura |
0:ad834d403a8c | 4 | * @author Doug Anson/Chris Paola |
Osamu Nakamura |
0:ad834d403a8c | 5 | * @version 1.0 |
Osamu Nakamura |
0:ad834d403a8c | 6 | * @see |
Osamu Nakamura |
0:ad834d403a8c | 7 | * |
Osamu Nakamura |
0:ad834d403a8c | 8 | * Copyright (c) 2014 |
Osamu Nakamura |
0:ad834d403a8c | 9 | * |
Osamu Nakamura |
0:ad834d403a8c | 10 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Osamu Nakamura |
0:ad834d403a8c | 11 | * you may not use this file except in compliance with the License. |
Osamu Nakamura |
0:ad834d403a8c | 12 | * You may obtain a copy of the License at |
Osamu Nakamura |
0:ad834d403a8c | 13 | * |
Osamu Nakamura |
0:ad834d403a8c | 14 | * http://www.apache.org/licenses/LICENSE-2.0 |
Osamu Nakamura |
0:ad834d403a8c | 15 | * |
Osamu Nakamura |
0:ad834d403a8c | 16 | * Unless required by applicable law or agreed to in writing, software |
Osamu Nakamura |
0:ad834d403a8c | 17 | * distributed under the License is distributed on an "AS IS" BASIS, |
Osamu Nakamura |
0:ad834d403a8c | 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Osamu Nakamura |
0:ad834d403a8c | 19 | * See the License for the specific language governing permissions and |
Osamu Nakamura |
0:ad834d403a8c | 20 | * limitations under the License. |
Osamu Nakamura |
0:ad834d403a8c | 21 | */ |
Osamu Nakamura |
0:ad834d403a8c | 22 | |
Osamu Nakamura |
0:ad834d403a8c | 23 | #ifndef __OPTIONS_H__ |
Osamu Nakamura |
0:ad834d403a8c | 24 | #define __OPTIONS_H__ |
Osamu Nakamura |
0:ad834d403a8c | 25 | |
Osamu Nakamura |
0:ad834d403a8c | 26 | // Static Resources |
Osamu Nakamura |
0:ad834d403a8c | 27 | #include "mbed-connector-interface/StaticResource.h" |
Osamu Nakamura |
0:ad834d403a8c | 28 | |
Osamu Nakamura |
0:ad834d403a8c | 29 | // Dynamic Resources |
Osamu Nakamura |
0:ad834d403a8c | 30 | #include "mbed-connector-interface/DynamicResource.h" |
Osamu Nakamura |
0:ad834d403a8c | 31 | |
Osamu Nakamura |
0:ad834d403a8c | 32 | // include the mbed connector resource list |
Osamu Nakamura |
0:ad834d403a8c | 33 | #include "mbed-connector-interface/mbedConnectorInterface.h" |
Osamu Nakamura |
0:ad834d403a8c | 34 | |
Osamu Nakamura |
0:ad834d403a8c | 35 | // include the resource observer includes here so that they are not required in main.cpp |
Osamu Nakamura |
0:ad834d403a8c | 36 | #include "mbed-connector-interface/ThreadedResourceObserver.h" |
Osamu Nakamura |
0:ad834d403a8c | 37 | #include "mbed-connector-interface/TickerResourceObserver.h" |
Osamu Nakamura |
0:ad834d403a8c | 38 | #include "mbed-connector-interface/MinarResourceObserver.h" |
Osamu Nakamura |
0:ad834d403a8c | 39 | |
Osamu Nakamura |
0:ad834d403a8c | 40 | // Vector support |
Osamu Nakamura |
0:ad834d403a8c | 41 | #include <vector> |
Osamu Nakamura |
0:ad834d403a8c | 42 | |
Osamu Nakamura |
0:ad834d403a8c | 43 | // Resources list |
Osamu Nakamura |
0:ad834d403a8c | 44 | typedef vector<StaticResource *> StaticResourcesList; |
Osamu Nakamura |
0:ad834d403a8c | 45 | typedef vector<DynamicResource *> DynamicResourcesList; |
Osamu Nakamura |
0:ad834d403a8c | 46 | typedef vector<ResourceObserver *> ResourceObserversList; |
Osamu Nakamura |
0:ad834d403a8c | 47 | |
Osamu Nakamura |
0:ad834d403a8c | 48 | // Default CoAP Port for mbed Cloud/Connector |
Osamu Nakamura |
0:ad834d403a8c | 49 | #define DEF_COAP_PORT 5684 |
Osamu Nakamura |
0:ad834d403a8c | 50 | |
Osamu Nakamura |
0:ad834d403a8c | 51 | // WiFi Security types (maps to wifi_security_t) |
Osamu Nakamura |
0:ad834d403a8c | 52 | typedef enum { |
Osamu Nakamura |
0:ad834d403a8c | 53 | WIFI_NONE = 0, |
Osamu Nakamura |
0:ad834d403a8c | 54 | WIFI_WEP, |
Osamu Nakamura |
0:ad834d403a8c | 55 | WIFI_WPA_PERSONAL, |
Osamu Nakamura |
0:ad834d403a8c | 56 | WIFI_WPA2_PERSONAL |
Osamu Nakamura |
0:ad834d403a8c | 57 | } WiFiAuthTypes; |
Osamu Nakamura |
0:ad834d403a8c | 58 | |
Osamu Nakamura |
0:ad834d403a8c | 59 | // Connection Types for CoAP |
Osamu Nakamura |
0:ad834d403a8c | 60 | typedef enum { |
Osamu Nakamura |
0:ad834d403a8c | 61 | COAP_TCP, |
Osamu Nakamura |
0:ad834d403a8c | 62 | COAP_UDP, |
Osamu Nakamura |
0:ad834d403a8c | 63 | COAP_NUM_TYPES |
Osamu Nakamura |
0:ad834d403a8c | 64 | } CoAPConnectionTypes; |
Osamu Nakamura |
0:ad834d403a8c | 65 | |
Osamu Nakamura |
0:ad834d403a8c | 66 | // IP Address Types |
Osamu Nakamura |
0:ad834d403a8c | 67 | typedef enum { |
Osamu Nakamura |
0:ad834d403a8c | 68 | IP_ADDRESS_TYPE_IPV4, |
Osamu Nakamura |
0:ad834d403a8c | 69 | IP_ADDRESS_TYPE_IPV6, |
Osamu Nakamura |
0:ad834d403a8c | 70 | IP_ADDRESS_TYPE_NUM_TYPES |
Osamu Nakamura |
0:ad834d403a8c | 71 | } IPAddressTypes; |
Osamu Nakamura |
0:ad834d403a8c | 72 | |
Osamu Nakamura |
0:ad834d403a8c | 73 | namespace Connector { |
Osamu Nakamura |
0:ad834d403a8c | 74 | |
Osamu Nakamura |
0:ad834d403a8c | 75 | /** Options class |
Osamu Nakamura |
0:ad834d403a8c | 76 | */ |
Osamu Nakamura |
0:ad834d403a8c | 77 | class Options |
Osamu Nakamura |
0:ad834d403a8c | 78 | { |
Osamu Nakamura |
0:ad834d403a8c | 79 | public: |
Osamu Nakamura |
0:ad834d403a8c | 80 | /** |
Osamu Nakamura |
0:ad834d403a8c | 81 | Default constructor |
Osamu Nakamura |
0:ad834d403a8c | 82 | */ |
Osamu Nakamura |
0:ad834d403a8c | 83 | Options(); |
Osamu Nakamura |
0:ad834d403a8c | 84 | |
Osamu Nakamura |
0:ad834d403a8c | 85 | /** |
Osamu Nakamura |
0:ad834d403a8c | 86 | Copy constructor |
Osamu Nakamura |
0:ad834d403a8c | 87 | */ |
Osamu Nakamura |
0:ad834d403a8c | 88 | Options(const Options &opt); |
Osamu Nakamura |
0:ad834d403a8c | 89 | |
Osamu Nakamura |
0:ad834d403a8c | 90 | /** |
Osamu Nakamura |
0:ad834d403a8c | 91 | Destructor |
Osamu Nakamura |
0:ad834d403a8c | 92 | */ |
Osamu Nakamura |
0:ad834d403a8c | 93 | virtual ~Options(); |
Osamu Nakamura |
0:ad834d403a8c | 94 | |
Osamu Nakamura |
0:ad834d403a8c | 95 | /** |
Osamu Nakamura |
0:ad834d403a8c | 96 | Get the node lifetime |
Osamu Nakamura |
0:ad834d403a8c | 97 | */ |
Osamu Nakamura |
0:ad834d403a8c | 98 | int getLifetime(); |
Osamu Nakamura |
0:ad834d403a8c | 99 | |
Osamu Nakamura |
0:ad834d403a8c | 100 | /** |
Osamu Nakamura |
0:ad834d403a8c | 101 | Get the NSP domain |
Osamu Nakamura |
0:ad834d403a8c | 102 | */ |
Osamu Nakamura |
0:ad834d403a8c | 103 | string getDomain(); |
Osamu Nakamura |
0:ad834d403a8c | 104 | |
Osamu Nakamura |
0:ad834d403a8c | 105 | /** |
Osamu Nakamura |
0:ad834d403a8c | 106 | Get the node name |
Osamu Nakamura |
0:ad834d403a8c | 107 | */ |
Osamu Nakamura |
0:ad834d403a8c | 108 | string getEndpointNodename(); |
Osamu Nakamura |
0:ad834d403a8c | 109 | |
Osamu Nakamura |
0:ad834d403a8c | 110 | /** |
Osamu Nakamura |
0:ad834d403a8c | 111 | Get the node type |
Osamu Nakamura |
0:ad834d403a8c | 112 | */ |
Osamu Nakamura |
0:ad834d403a8c | 113 | string getEndpointType(); |
Osamu Nakamura |
0:ad834d403a8c | 114 | |
Osamu Nakamura |
0:ad834d403a8c | 115 | /** |
Osamu Nakamura |
0:ad834d403a8c | 116 | Get the endpoint Connector URL |
Osamu Nakamura |
0:ad834d403a8c | 117 | */ |
Osamu Nakamura |
0:ad834d403a8c | 118 | char *getConnectorURL(); |
Osamu Nakamura |
0:ad834d403a8c | 119 | |
Osamu Nakamura |
0:ad834d403a8c | 120 | /** |
Osamu Nakamura |
0:ad834d403a8c | 121 | Get the connector connection port from the URL |
Osamu Nakamura |
0:ad834d403a8c | 122 | */ |
Osamu Nakamura |
0:ad834d403a8c | 123 | uint16_t getConnectorPort(); |
Osamu Nakamura |
0:ad834d403a8c | 124 | |
Osamu Nakamura |
0:ad834d403a8c | 125 | /** |
Osamu Nakamura |
0:ad834d403a8c | 126 | Get the Device Resources Object Instance |
Osamu Nakamura |
0:ad834d403a8c | 127 | */ |
Osamu Nakamura |
0:ad834d403a8c | 128 | void *getDeviceResourcesObject(); |
Osamu Nakamura |
0:ad834d403a8c | 129 | |
Osamu Nakamura |
0:ad834d403a8c | 130 | /** |
Osamu Nakamura |
0:ad834d403a8c | 131 | Get the Firmware Resources Object Instance |
Osamu Nakamura |
0:ad834d403a8c | 132 | */ |
Osamu Nakamura |
0:ad834d403a8c | 133 | void *getFirmwareResourcesObject(); |
Osamu Nakamura |
0:ad834d403a8c | 134 | |
Osamu Nakamura |
0:ad834d403a8c | 135 | /** |
Osamu Nakamura |
0:ad834d403a8c | 136 | Get the list of static resources |
Osamu Nakamura |
0:ad834d403a8c | 137 | */ |
Osamu Nakamura |
0:ad834d403a8c | 138 | StaticResourcesList *getStaticResourceList(); |
Osamu Nakamura |
0:ad834d403a8c | 139 | |
Osamu Nakamura |
0:ad834d403a8c | 140 | /** |
Osamu Nakamura |
0:ad834d403a8c | 141 | Get the list of dynamic resources |
Osamu Nakamura |
0:ad834d403a8c | 142 | */ |
Osamu Nakamura |
0:ad834d403a8c | 143 | DynamicResourcesList *getDynamicResourceList(); |
Osamu Nakamura |
0:ad834d403a8c | 144 | |
Osamu Nakamura |
0:ad834d403a8c | 145 | /** |
Osamu Nakamura |
0:ad834d403a8c | 146 | Get the WiFi SSID |
Osamu Nakamura |
0:ad834d403a8c | 147 | */ |
Osamu Nakamura |
0:ad834d403a8c | 148 | string getWiFiSSID(); |
Osamu Nakamura |
0:ad834d403a8c | 149 | |
Osamu Nakamura |
0:ad834d403a8c | 150 | /** |
Osamu Nakamura |
0:ad834d403a8c | 151 | Get the WiFi Auth Type |
Osamu Nakamura |
0:ad834d403a8c | 152 | */ |
Osamu Nakamura |
0:ad834d403a8c | 153 | WiFiAuthTypes getWiFiAuthType(); |
Osamu Nakamura |
0:ad834d403a8c | 154 | |
Osamu Nakamura |
0:ad834d403a8c | 155 | /** |
Osamu Nakamura |
0:ad834d403a8c | 156 | Get the WiFi Auth Key |
Osamu Nakamura |
0:ad834d403a8c | 157 | */ |
Osamu Nakamura |
0:ad834d403a8c | 158 | string getWiFiAuthKey(); |
Osamu Nakamura |
0:ad834d403a8c | 159 | |
Osamu Nakamura |
0:ad834d403a8c | 160 | /** |
Osamu Nakamura |
0:ad834d403a8c | 161 | Get the CoAP Connection Type |
Osamu Nakamura |
0:ad834d403a8c | 162 | */ |
Osamu Nakamura |
0:ad834d403a8c | 163 | CoAPConnectionTypes getCoAPConnectionType(); |
Osamu Nakamura |
0:ad834d403a8c | 164 | |
Osamu Nakamura |
0:ad834d403a8c | 165 | /** |
Osamu Nakamura |
0:ad834d403a8c | 166 | Get the IP Address Type |
Osamu Nakamura |
0:ad834d403a8c | 167 | */ |
Osamu Nakamura |
0:ad834d403a8c | 168 | IPAddressTypes getIPAddressType(); |
Osamu Nakamura |
0:ad834d403a8c | 169 | |
Osamu Nakamura |
0:ad834d403a8c | 170 | /** |
Osamu Nakamura |
0:ad834d403a8c | 171 | Enable/Disable Immediate Observationing |
Osamu Nakamura |
0:ad834d403a8c | 172 | */ |
Osamu Nakamura |
0:ad834d403a8c | 173 | bool immedateObservationEnabled(); |
Osamu Nakamura |
0:ad834d403a8c | 174 | |
Osamu Nakamura |
0:ad834d403a8c | 175 | /** |
Osamu Nakamura |
0:ad834d403a8c | 176 | Enable/Disable Observation control via GET |
Osamu Nakamura |
0:ad834d403a8c | 177 | */ |
Osamu Nakamura |
0:ad834d403a8c | 178 | bool enableGETObservationControl(); |
Osamu Nakamura |
0:ad834d403a8c | 179 | |
Osamu Nakamura |
0:ad834d403a8c | 180 | /** |
Osamu Nakamura |
0:ad834d403a8c | 181 | Get the Server Certificate |
Osamu Nakamura |
0:ad834d403a8c | 182 | */ |
Osamu Nakamura |
0:ad834d403a8c | 183 | uint8_t *getServerCertificate(); |
Osamu Nakamura |
0:ad834d403a8c | 184 | |
Osamu Nakamura |
0:ad834d403a8c | 185 | /** |
Osamu Nakamura |
0:ad834d403a8c | 186 | Get the Server Certificate Size (bytes) |
Osamu Nakamura |
0:ad834d403a8c | 187 | */ |
Osamu Nakamura |
0:ad834d403a8c | 188 | int getServerCertificateSize(); |
Osamu Nakamura |
0:ad834d403a8c | 189 | |
Osamu Nakamura |
0:ad834d403a8c | 190 | /** |
Osamu Nakamura |
0:ad834d403a8c | 191 | Get the Client Certificate |
Osamu Nakamura |
0:ad834d403a8c | 192 | */ |
Osamu Nakamura |
0:ad834d403a8c | 193 | uint8_t *getClientCertificate(); |
Osamu Nakamura |
0:ad834d403a8c | 194 | |
Osamu Nakamura |
0:ad834d403a8c | 195 | /** |
Osamu Nakamura |
0:ad834d403a8c | 196 | Get the Client Certificate Size (bytes) |
Osamu Nakamura |
0:ad834d403a8c | 197 | */ |
Osamu Nakamura |
0:ad834d403a8c | 198 | int getClientCertificateSize(); |
Osamu Nakamura |
0:ad834d403a8c | 199 | |
Osamu Nakamura |
0:ad834d403a8c | 200 | /** |
Osamu Nakamura |
0:ad834d403a8c | 201 | Get the Client Key |
Osamu Nakamura |
0:ad834d403a8c | 202 | */ |
Osamu Nakamura |
0:ad834d403a8c | 203 | uint8_t *getClientKey(); |
Osamu Nakamura |
0:ad834d403a8c | 204 | |
Osamu Nakamura |
0:ad834d403a8c | 205 | /** |
Osamu Nakamura |
0:ad834d403a8c | 206 | Get the Client Key Size (bytes) |
Osamu Nakamura |
0:ad834d403a8c | 207 | */ |
Osamu Nakamura |
0:ad834d403a8c | 208 | int getClientKeySize(); |
Osamu Nakamura |
0:ad834d403a8c | 209 | |
Osamu Nakamura |
0:ad834d403a8c | 210 | /** |
Osamu Nakamura |
0:ad834d403a8c | 211 | Get Our Endpoint |
Osamu Nakamura |
0:ad834d403a8c | 212 | */ |
Osamu Nakamura |
0:ad834d403a8c | 213 | void *getEndpoint(); |
Osamu Nakamura |
0:ad834d403a8c | 214 | |
Osamu Nakamura |
0:ad834d403a8c | 215 | protected: |
Osamu Nakamura |
0:ad834d403a8c | 216 | // mDS Resources |
Osamu Nakamura |
0:ad834d403a8c | 217 | int m_lifetime; |
Osamu Nakamura |
0:ad834d403a8c | 218 | string m_domain; |
Osamu Nakamura |
0:ad834d403a8c | 219 | string m_node_name; |
Osamu Nakamura |
0:ad834d403a8c | 220 | string m_endpoint_type; |
Osamu Nakamura |
0:ad834d403a8c | 221 | string m_connector_url; |
Osamu Nakamura |
0:ad834d403a8c | 222 | |
Osamu Nakamura |
0:ad834d403a8c | 223 | // WiFi Resources |
Osamu Nakamura |
0:ad834d403a8c | 224 | string m_wifi_ssid; |
Osamu Nakamura |
0:ad834d403a8c | 225 | string m_wifi_auth_key; |
Osamu Nakamura |
0:ad834d403a8c | 226 | WiFiAuthTypes m_wifi_auth_type; |
Osamu Nakamura |
0:ad834d403a8c | 227 | |
Osamu Nakamura |
0:ad834d403a8c | 228 | // CoAP Connection Types |
Osamu Nakamura |
0:ad834d403a8c | 229 | CoAPConnectionTypes m_coap_connection_type; |
Osamu Nakamura |
0:ad834d403a8c | 230 | |
Osamu Nakamura |
0:ad834d403a8c | 231 | // IP Address Types |
Osamu Nakamura |
0:ad834d403a8c | 232 | IPAddressTypes m_ip_address_type; |
Osamu Nakamura |
0:ad834d403a8c | 233 | |
Osamu Nakamura |
0:ad834d403a8c | 234 | // DTLS/TLS Resources |
Osamu Nakamura |
0:ad834d403a8c | 235 | uint8_t *m_server_cert; |
Osamu Nakamura |
0:ad834d403a8c | 236 | int m_server_cert_length; |
Osamu Nakamura |
0:ad834d403a8c | 237 | uint8_t *m_client_cert; |
Osamu Nakamura |
0:ad834d403a8c | 238 | int m_client_cert_length; |
Osamu Nakamura |
0:ad834d403a8c | 239 | uint8_t *m_client_key; |
Osamu Nakamura |
0:ad834d403a8c | 240 | int m_client_key_length; |
Osamu Nakamura |
0:ad834d403a8c | 241 | |
Osamu Nakamura |
0:ad834d403a8c | 242 | // CoAP behavior adjustments |
Osamu Nakamura |
0:ad834d403a8c | 243 | bool m_enable_immediate_observation; |
Osamu Nakamura |
0:ad834d403a8c | 244 | bool m_enable_get_obs_control; |
Osamu Nakamura |
0:ad834d403a8c | 245 | |
Osamu Nakamura |
0:ad834d403a8c | 246 | // Endpoint Resources |
Osamu Nakamura |
0:ad834d403a8c | 247 | void *m_device_resources_object; |
Osamu Nakamura |
0:ad834d403a8c | 248 | void *m_firmware_resources_object; |
Osamu Nakamura |
0:ad834d403a8c | 249 | StaticResourcesList m_static_resources; |
Osamu Nakamura |
0:ad834d403a8c | 250 | DynamicResourcesList m_dynamic_resources; |
Osamu Nakamura |
0:ad834d403a8c | 251 | ResourceObserversList m_resource_observers; |
Osamu Nakamura |
0:ad834d403a8c | 252 | |
Osamu Nakamura |
0:ad834d403a8c | 253 | // Our Endpoint |
Osamu Nakamura |
0:ad834d403a8c | 254 | void *m_endpoint; |
Osamu Nakamura |
0:ad834d403a8c | 255 | }; |
Osamu Nakamura |
0:ad834d403a8c | 256 | |
Osamu Nakamura |
0:ad834d403a8c | 257 | } // namespace Connector |
Osamu Nakamura |
0:ad834d403a8c | 258 | |
Osamu Nakamura |
0:ad834d403a8c | 259 | #endif // __OPTIONS_H__ |