Sebastián Pastor / EtheriosCloudConnector
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ecc_platform.h Source File

ecc_platform.h

00001 /*
00002  * Copyright (c) 2013 Digi International Inc.,
00003  * All rights not expressly granted are reserved.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
00007  * You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
00010  * =======================================================================
00011  */
00012 
00013 #ifndef _PLATFORM_H
00014 #define _PLATFORM_H
00015 
00016 #include <stdio.h>
00017 #include "connector_debug.h"
00018 
00019 #define APP_DEBUG   printf
00020 
00021 #define UNUSED_ARGUMENT(x)     ((void)x)
00022 
00023 /* GCC emits a warning message for alignment issues when casting. Normally we fix these by reorganizing our structures.
00024    In some cases these structures are in system header files and cannot be changed. This macro should be used in those situations. */
00025 #define cast_for_alignment(cast, ptr)   ((cast) ((void *) (ptr)))
00026 
00027 
00028 typedef enum {
00029     connector_connector_idle,
00030     connector_connector_running
00031 } connector_connector_state_t;
00032 
00033 extern connector_callback_status_t app_connector_callback(connector_class_id_t const class_id,
00034                                                           connector_request_id_t const request_id,
00035                                                           void * const data);
00036 
00037 /* Callbacks for this platform */
00038 extern connector_callback_status_t app_os_handler(connector_request_id_os_t const request,
00039                                                   void * const data);
00040 
00041 extern connector_callback_status_t app_network_tcp_handler(connector_request_id_network_t const request,
00042                                                            void * const data);
00043 
00044 extern connector_callback_status_t app_network_udp_handler(connector_request_id_network_t const request,
00045                                                            void * const data);
00046 
00047 extern connector_callback_status_t app_network_sms_handler(connector_request_id_network_t const request,
00048                                                            void * const data);
00049 
00050 extern connector_callback_status_t app_config_handler(connector_request_id_config_t const request,
00051                                                       void * const data);
00052 
00053 #if (defined CONNECTOR_FILE_SYSTEM)
00054 extern connector_callback_status_t app_file_system_handler(connector_request_id_file_system_t const request,
00055                                                            void * const data);
00056 #endif
00057 
00058 extern int application_run(connector_handle_t handle);
00059 
00060 extern connector_callback_status_t app_os_get_system_time(unsigned long * const uptime);
00061 
00062 extern connector_bool_t app_connector_reconnect(connector_class_id_t const class_id, connector_close_status_t const status);
00063 extern connector_callback_status_t app_status_handler(connector_request_id_status_t const request,
00064                                                       void * const data);
00065 
00066 #if !(defined APP_SSL_CA_CERT_PATH)
00067 #define APP_SSL_CA_CERT_PATH   "../../../../public/certificates/etherios-ca-cert-public.crt"
00068 #endif
00069 #endif
00070