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
spastor 0:1c358ea10753 14 #define GROUP_ID_VARIABLE(rci) ((rci)->shared.group.id)
spastor 0:1c358ea10753 15 #define set_group_id(rci, value) (GROUP_ID_VARIABLE(rci) = (value))
spastor 0:1c358ea10753 16 #define get_group_id(rci) (GROUP_ID_VARIABLE(rci))
spastor 0:1c358ea10753 17 #define invalidate_group_id(rci) set_group_id(rci, INVALID_ID)
spastor 0:1c358ea10753 18 #define have_group_id(rci) (get_group_id(rci) != INVALID_ID)
spastor 0:1c358ea10753 19 #define increment_group_id(rci) (GROUP_ID_VARIABLE(rci)++)
spastor 0:1c358ea10753 20
spastor 0:1c358ea10753 21 #define GROUP_INDEX_VARIABLE(rci) ((rci)->shared.group.index)
spastor 0:1c358ea10753 22 #define set_group_index(rci, value) (GROUP_INDEX_VARIABLE(rci) = (value))
spastor 0:1c358ea10753 23 #define get_group_index(rci) (GROUP_INDEX_VARIABLE(rci))
spastor 0:1c358ea10753 24 #define increment_group_index(rci) (GROUP_INDEX_VARIABLE(rci)++)
spastor 0:1c358ea10753 25 #define invalidate_group_index(rci) set_group_index(rci, INVALID_INDEX)
spastor 0:1c358ea10753 26 #define have_group_index(rci) (get_group_index(rci) != INVALID_INDEX)
spastor 0:1c358ea10753 27
spastor 0:1c358ea10753 28 static connector_group_t const * get_current_group(rci_t const * const rci)
spastor 0:1c358ea10753 29 {
spastor 0:1c358ea10753 30 connector_remote_group_table_t const * const table = (connector_rci_config_data.group_table + rci->shared.callback_data.group.type);
spastor 0:1c358ea10753 31 unsigned int const group_id = get_group_id(rci);
spastor 0:1c358ea10753 32
spastor 0:1c358ea10753 33 ASSERT(have_group_id(rci));
spastor 0:1c358ea10753 34 ASSERT(group_id < table->count);
spastor 0:1c358ea10753 35
spastor 0:1c358ea10753 36 return (table->groups + group_id);
spastor 0:1c358ea10753 37 }
spastor 0:1c358ea10753 38
spastor 0:1c358ea10753 39
spastor 0:1c358ea10753 40