Axeda Ready Demo for Freescale FRDM-KL46Z as accident alert system

Dependencies:   FRDM_MMA8451Q KL46Z-USBHost MAG3110 SocketModem TSI mbed FATFileSystem

Fork of AxedaGo-Freescal_FRDM-KL46Z revert by Axeda Corp

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers axPlatform.h Source File

axPlatform.h

00001 /************************************************************************************/
00002 /* axPlatform.h                                                                    */
00003 /* 2013 Axeda Corporation                                                          */
00004 /*                                                                                  */
00005 /* Defines methods for interaction with end points on the Axeda Platform.  This     */
00006 /* is a device independent implementation which can be applied to any device that   */
00007 /* supports ANSI C.                                                                 */
00008 /************************************************************************************/
00009 
00010 #ifndef AXPLATFORM_H
00011 #define AXPLATFORM_H
00012 
00013 #include "axTypes.h"
00014 #include <stdio.h>
00015 
00016 
00017 #define END_BASE     0
00018 #define END_DATA     1
00019 #define END_AGENTS   2
00020 #define END_FILES    3
00021 #define END_FILED    4
00022 #define END_PACKAGES 5
00023 #define END_STATUS   6
00024 #define END_REG      7
00025 
00026 #define BUFF_ALARMS     0
00027 #define BUFF_EVENTS     1
00028 #define BUFF_DATA       2
00029 #define BUFF_LOCATIONS  3
00030 
00031 #define PKG_QUEUED      0
00032 #define PKG_STARTED     1
00033 #define PKG_SUCCESS     2
00034 #define PKG_FAILURE     3
00035 
00036 #ifdef __cplusplus 
00037   extern "C" {
00038 #endif
00039 
00040 
00041 int ax_platform_send(ax_platform *cloud, ax_deviceID *device, ax_dataSet *dataItems[], int numDataSets, ax_alarm *alarms[], int numAlarms, ax_event *events[], int numEvents, ax_location *locations[], int numLocations);
00042 int ax_platform_sendData(ax_platform *cloud, ax_deviceID *device, ax_dataSet *dataItems[], int numDataSets);
00043 int ax_platform_sendAlarms(ax_platform *cloud, ax_deviceID *device, ax_alarm *alarms[], int numAlarms);
00044 int ax_platform_sendEvents(ax_platform *cloud, ax_deviceID *device, ax_event *events[], int numEvents);
00045 int ax_platform_sendLocations(ax_platform *cloud, ax_deviceID *device, ax_location *locations[], int numLocations);
00046 
00047 int ax_platform_register(ax_platform *cloud, ax_deviceID *device);
00048 int ax_platform_ping(ax_platform *cloud, ax_deviceID *device);
00049 int ax_platform_upload(ax_platform *cloud, ax_deviceID *device, ax_file *file);
00050 int ax_platform_download(ax_platform *cloud, ax_deviceID *device, ax_package_instruction *instr);
00051 
00052 int ax_platform_setPkgStatus(ax_platform *cloud, ax_deviceID *device, char *pkgID, int status, char *errorMsg);
00053 int ax_platform_setPkgStatusStarted(ax_platform *cloud, ax_deviceID *device, char *pkgID);
00054 int ax_platform_setPkgStatusQueued(ax_platform *cloud, ax_deviceID *device, char *pkgID);
00055 int ax_platform_setPkgStatusSuccess(ax_platform *cloud, ax_deviceID *device, char *pkgID);
00056 int ax_platform_setPkgStatusFailed(ax_platform *cloud, ax_deviceID *device, char *pkgID, char *errorMsg);
00057 /*******************************************************************************************************/
00058 /*The following functions are internal only and should never need to be called outside of this library*/
00059 /*****************************************************************************************************/
00060 char *encodeAgentID(ax_deviceID *device, char *buff);
00061 char *getResource(char *endPointBuff, ax_deviceID *device, int resourceType);
00062 char *getDataResource(char *endPointBuff, ax_deviceID *device);
00063 char *getAgentResource(char *endPointBuff, ax_deviceID *device);
00064 char *getFileResource(char *endPointBuff, ax_deviceID *device);
00065 char *getRegistrationResource(char *endPointBuff, ax_deviceID *device);
00066 char *getFileDownloadResource(char *endPointBuff, ax_deviceID *device, char *fileID);
00067 char *getPackageUpdateResource(char *endPointBuff, ax_deviceID *device, char *packageID);
00068 
00069 char *getContentType(char *contentBuff, int type);
00070 char *getGeneralType(char *contentBuff);
00071 
00072 #ifdef __cplusplus
00073   }
00074 #endif
00075 
00076 #endif
00077