Etherios Cloud Connector very first porting for mbed. Tested in an LPC1768
Etherios Cloud Connector for Embedded v2.1.0.3 library for mbed. Early porting.
This port is centered mainly in the platform code. So it should work properly with the provided examples of send_data, device_request, data_points, RCI and firmware_update (stub implementation, not a real one... yet ;-)). Filesystem is not implemented yet, and some examples might need changes.
To run, it needs the following libraries: - mbed - mbed-rtos - EthernetInterface
Find more information (and the source code!) about Etherios Cloud Connector for Embedded here: http://www.etherios.com/products/devicecloud/support/connector and in: http://www.etherios.com
private/debug.h@1:908afea5a49d, 2013-12-03 (annotated)
- Committer:
- spastor
- Date:
- Tue Dec 03 14:10:48 2013 +0000
- Revision:
- 1:908afea5a49d
- Parent:
- 0:1c358ea10753
Use internal Thread.h instead of Threads.h
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
spastor | 0:1c358ea10753 | 1 | /* |
spastor | 0:1c358ea10753 | 2 | * Copyright (c) 2013 Digi International Inc., |
spastor | 0:1c358ea10753 | 3 | * All rights not expressly granted are reserved. |
spastor | 0:1c358ea10753 | 4 | * |
spastor | 0:1c358ea10753 | 5 | * This Source Code Form is subject to the terms of the Mozilla Public |
spastor | 0:1c358ea10753 | 6 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
spastor | 0:1c358ea10753 | 7 | * You can obtain one at http://mozilla.org/MPL/2.0/. |
spastor | 0:1c358ea10753 | 8 | * |
spastor | 0:1c358ea10753 | 9 | * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 |
spastor | 0:1c358ea10753 | 10 | * ======================================================================= |
spastor | 0:1c358ea10753 | 11 | */ |
spastor | 0:1c358ea10753 | 12 | |
spastor | 0:1c358ea10753 | 13 | #if (defined CONNECTOR_DEBUG) |
spastor | 0:1c358ea10753 | 14 | |
spastor | 0:1c358ea10753 | 15 | #define enum_to_case(name) case name: result = #name; break |
spastor | 0:1c358ea10753 | 16 | |
spastor | 0:1c358ea10753 | 17 | void connector_debug_hexvalue(char * label, uint8_t * buff, size_t length) |
spastor | 0:1c358ea10753 | 18 | { |
spastor | 0:1c358ea10753 | 19 | size_t i; |
spastor | 0:1c358ea10753 | 20 | |
spastor | 0:1c358ea10753 | 21 | connector_debug_printf("%s = ", label); |
spastor | 0:1c358ea10753 | 22 | for (i=0; i<length; i++) |
spastor | 0:1c358ea10753 | 23 | { |
spastor | 0:1c358ea10753 | 24 | connector_debug_printf(" %02X", buff[i]); |
spastor | 0:1c358ea10753 | 25 | if (i > 0 && (i % 16) == 0) |
spastor | 0:1c358ea10753 | 26 | { |
spastor | 0:1c358ea10753 | 27 | connector_debug_printf("\n%.*s", (strlen(label)+3), " "); |
spastor | 0:1c358ea10753 | 28 | } |
spastor | 0:1c358ea10753 | 29 | } |
spastor | 0:1c358ea10753 | 30 | connector_debug_printf("\n"); |
spastor | 0:1c358ea10753 | 31 | } |
spastor | 0:1c358ea10753 | 32 | |
spastor | 0:1c358ea10753 | 33 | #else |
spastor | 0:1c358ea10753 | 34 | #define connector_debug_hexvalue(label, start, length) |
spastor | 0:1c358ea10753 | 35 | |
spastor | 0:1c358ea10753 | 36 | static void connector_debug_printf(char const * const format, ...) |
spastor | 0:1c358ea10753 | 37 | { |
spastor | 0:1c358ea10753 | 38 | (void) format; |
spastor | 0:1c358ea10753 | 39 | } |
spastor | 0:1c358ea10753 | 40 | |
spastor | 0:1c358ea10753 | 41 | #endif |
spastor | 0:1c358ea10753 | 42 | |
spastor | 0:1c358ea10753 | 43 | #if (defined CONNECTOR_DEBUG) |
spastor | 0:1c358ea10753 | 44 | |
spastor | 0:1c358ea10753 | 45 | static char const * transport_to_string(connector_transport_t const value) |
spastor | 0:1c358ea10753 | 46 | { |
spastor | 0:1c358ea10753 | 47 | char const * result = NULL; |
spastor | 0:1c358ea10753 | 48 | switch (value) |
spastor | 0:1c358ea10753 | 49 | { |
spastor | 0:1c358ea10753 | 50 | #if (defined CONNECTOR_TRANSPORT_TCP) |
spastor | 0:1c358ea10753 | 51 | enum_to_case(connector_transport_tcp); |
spastor | 0:1c358ea10753 | 52 | #endif |
spastor | 0:1c358ea10753 | 53 | #if (defined CONNECTOR_TRANSPORT_UDP) |
spastor | 0:1c358ea10753 | 54 | enum_to_case(connector_transport_udp); |
spastor | 0:1c358ea10753 | 55 | #endif |
spastor | 0:1c358ea10753 | 56 | #if (defined CONNECTOR_TRANSPORT_SMS) |
spastor | 0:1c358ea10753 | 57 | enum_to_case(connector_transport_sms); |
spastor | 0:1c358ea10753 | 58 | #endif |
spastor | 0:1c358ea10753 | 59 | enum_to_case(connector_transport_all); |
spastor | 0:1c358ea10753 | 60 | } |
spastor | 0:1c358ea10753 | 61 | return result; |
spastor | 0:1c358ea10753 | 62 | } |
spastor | 0:1c358ea10753 | 63 | #else |
spastor | 0:1c358ea10753 | 64 | |
spastor | 0:1c358ea10753 | 65 | #define transport_to_string(value) NULL |
spastor | 0:1c358ea10753 | 66 | #endif |
spastor | 0:1c358ea10753 | 67 | |
spastor | 0:1c358ea10753 | 68 |