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

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?

UserRevisionLine numberNew 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 RCI_DEBUG)
spastor 0:1c358ea10753 14
spastor 0:1c358ea10753 15 static void rci_debug_printf(char const * const format, ...)
spastor 0:1c358ea10753 16 {
spastor 0:1c358ea10753 17 (void) format;
spastor 0:1c358ea10753 18 }
spastor 0:1c358ea10753 19
spastor 0:1c358ea10753 20 #define rci_input_state_t_as_string(value) NULL
spastor 0:1c358ea10753 21 #define rci_output_state_t_as_string(value) NULL
spastor 0:1c358ea10753 22 #define rci_traverse_state_t_as_string(value) NULL
spastor 0:1c358ea10753 23
spastor 0:1c358ea10753 24 #else
spastor 0:1c358ea10753 25
spastor 0:1c358ea10753 26 #define rci_debug_printf connector_debug_printf
spastor 0:1c358ea10753 27
spastor 0:1c358ea10753 28 #define enum_to_case(name) case name: result = #name; break
spastor 0:1c358ea10753 29
spastor 0:1c358ea10753 30 static char const * rci_input_state_t_as_string(rci_input_state_t const value)
spastor 0:1c358ea10753 31 {
spastor 0:1c358ea10753 32 char const * result=NULL;
spastor 0:1c358ea10753 33 switch (value)
spastor 0:1c358ea10753 34 {
spastor 0:1c358ea10753 35 enum_to_case(rci_input_state_command_id);
spastor 0:1c358ea10753 36 enum_to_case(rci_input_state_command_attribute);
spastor 0:1c358ea10753 37 enum_to_case(rci_input_state_group_id);
spastor 0:1c358ea10753 38 enum_to_case(rci_input_state_group_attribute);
spastor 0:1c358ea10753 39 enum_to_case(rci_input_state_field_id);
spastor 0:1c358ea10753 40 enum_to_case(rci_input_state_field_type);
spastor 0:1c358ea10753 41 enum_to_case(rci_input_state_field_no_value);
spastor 0:1c358ea10753 42 enum_to_case(rci_input_state_field_value);
spastor 0:1c358ea10753 43 enum_to_case(rci_input_state_done);
spastor 0:1c358ea10753 44 }
spastor 0:1c358ea10753 45 return result;
spastor 0:1c358ea10753 46 }
spastor 0:1c358ea10753 47
spastor 0:1c358ea10753 48 static char const * rci_output_state_t_as_string(rci_output_state_t const value)
spastor 0:1c358ea10753 49 {
spastor 0:1c358ea10753 50 char const * result=NULL;
spastor 0:1c358ea10753 51 switch (value)
spastor 0:1c358ea10753 52 {
spastor 0:1c358ea10753 53 enum_to_case(rci_output_state_command_id);
spastor 0:1c358ea10753 54 enum_to_case(rci_output_state_group_id);
spastor 0:1c358ea10753 55 enum_to_case(rci_output_state_group_attribute);
spastor 0:1c358ea10753 56 enum_to_case(rci_output_state_field_id);
spastor 0:1c358ea10753 57 enum_to_case(rci_output_state_field_value);
spastor 0:1c358ea10753 58 enum_to_case(rci_output_state_field_terminator);
spastor 0:1c358ea10753 59 enum_to_case(rci_output_state_group_terminator);
spastor 0:1c358ea10753 60 enum_to_case(rci_output_state_response_done);
spastor 0:1c358ea10753 61 enum_to_case(rci_output_state_done);
spastor 0:1c358ea10753 62 }
spastor 0:1c358ea10753 63 return result;
spastor 0:1c358ea10753 64 }
spastor 0:1c358ea10753 65
spastor 0:1c358ea10753 66 static char const * rci_traverse_state_t_as_string(rci_traverse_state_t const value)
spastor 0:1c358ea10753 67 {
spastor 0:1c358ea10753 68 char const * result=NULL;
spastor 0:1c358ea10753 69 switch (value)
spastor 0:1c358ea10753 70 {
spastor 0:1c358ea10753 71 enum_to_case(rci_traverse_state_none);
spastor 0:1c358ea10753 72 enum_to_case(rci_traverse_state_command_id);
spastor 0:1c358ea10753 73 enum_to_case(rci_traverse_state_group_id);
spastor 0:1c358ea10753 74 enum_to_case(rci_traverse_state_element_id);
spastor 0:1c358ea10753 75 enum_to_case(rci_traverse_state_element_end);
spastor 0:1c358ea10753 76 enum_to_case(rci_traverse_state_group_end);
spastor 0:1c358ea10753 77 enum_to_case(rci_traverse_state_all_groups);
spastor 0:1c358ea10753 78 enum_to_case(rci_traverse_state_all_group_instances);
spastor 0:1c358ea10753 79 enum_to_case(rci_traverse_state_all_elements);
spastor 0:1c358ea10753 80 }
spastor 0:1c358ea10753 81 return result;
spastor 0:1c358ea10753 82 }
spastor 0:1c358ea10753 83
spastor 0:1c358ea10753 84 #endif
spastor 0:1c358ea10753 85