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 by
AMMPC/axPlatform.h@2:2f9019c5a9fc, 2014-07-02 (annotated)
- Committer:
- AxedaCorp
- Date:
- Wed Jul 02 19:57:37 2014 +0000
- Revision:
- 2:2f9019c5a9fc
- Parent:
- 0:65004368569c
ip switch
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AxedaCorp | 0:65004368569c | 1 | /************************************************************************************/ |
AxedaCorp | 0:65004368569c | 2 | /* axPlatform.h */ |
AxedaCorp | 0:65004368569c | 3 | /* 2013 Axeda Corporation */ |
AxedaCorp | 0:65004368569c | 4 | /* */ |
AxedaCorp | 0:65004368569c | 5 | /* Defines methods for interaction with end points on the Axeda Platform. This */ |
AxedaCorp | 0:65004368569c | 6 | /* is a device independent implementation which can be applied to any device that */ |
AxedaCorp | 0:65004368569c | 7 | /* supports ANSI C. */ |
AxedaCorp | 0:65004368569c | 8 | /************************************************************************************/ |
AxedaCorp | 0:65004368569c | 9 | |
AxedaCorp | 0:65004368569c | 10 | #ifndef AXPLATFORM_H |
AxedaCorp | 0:65004368569c | 11 | #define AXPLATFORM_H |
AxedaCorp | 0:65004368569c | 12 | |
AxedaCorp | 0:65004368569c | 13 | #include "axTypes.h" |
AxedaCorp | 0:65004368569c | 14 | #include <stdio.h> |
AxedaCorp | 0:65004368569c | 15 | |
AxedaCorp | 0:65004368569c | 16 | |
AxedaCorp | 0:65004368569c | 17 | #define END_BASE 0 |
AxedaCorp | 0:65004368569c | 18 | #define END_DATA 1 |
AxedaCorp | 0:65004368569c | 19 | #define END_AGENTS 2 |
AxedaCorp | 0:65004368569c | 20 | #define END_FILES 3 |
AxedaCorp | 0:65004368569c | 21 | #define END_FILED 4 |
AxedaCorp | 0:65004368569c | 22 | #define END_PACKAGES 5 |
AxedaCorp | 0:65004368569c | 23 | #define END_STATUS 6 |
AxedaCorp | 0:65004368569c | 24 | #define END_REG 7 |
AxedaCorp | 0:65004368569c | 25 | |
AxedaCorp | 0:65004368569c | 26 | #define BUFF_ALARMS 0 |
AxedaCorp | 0:65004368569c | 27 | #define BUFF_EVENTS 1 |
AxedaCorp | 0:65004368569c | 28 | #define BUFF_DATA 2 |
AxedaCorp | 0:65004368569c | 29 | #define BUFF_LOCATIONS 3 |
AxedaCorp | 0:65004368569c | 30 | |
AxedaCorp | 0:65004368569c | 31 | #define PKG_QUEUED 0 |
AxedaCorp | 0:65004368569c | 32 | #define PKG_STARTED 1 |
AxedaCorp | 0:65004368569c | 33 | #define PKG_SUCCESS 2 |
AxedaCorp | 0:65004368569c | 34 | #define PKG_FAILURE 3 |
AxedaCorp | 0:65004368569c | 35 | |
AxedaCorp | 0:65004368569c | 36 | #ifdef __cplusplus |
AxedaCorp | 0:65004368569c | 37 | extern "C" { |
AxedaCorp | 0:65004368569c | 38 | #endif |
AxedaCorp | 0:65004368569c | 39 | |
AxedaCorp | 0:65004368569c | 40 | |
AxedaCorp | 0:65004368569c | 41 | 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); |
AxedaCorp | 0:65004368569c | 42 | int ax_platform_sendData(ax_platform *cloud, ax_deviceID *device, ax_dataSet *dataItems[], int numDataSets); |
AxedaCorp | 0:65004368569c | 43 | int ax_platform_sendAlarms(ax_platform *cloud, ax_deviceID *device, ax_alarm *alarms[], int numAlarms); |
AxedaCorp | 0:65004368569c | 44 | int ax_platform_sendEvents(ax_platform *cloud, ax_deviceID *device, ax_event *events[], int numEvents); |
AxedaCorp | 0:65004368569c | 45 | int ax_platform_sendLocations(ax_platform *cloud, ax_deviceID *device, ax_location *locations[], int numLocations); |
AxedaCorp | 0:65004368569c | 46 | |
AxedaCorp | 0:65004368569c | 47 | int ax_platform_register(ax_platform *cloud, ax_deviceID *device); |
AxedaCorp | 0:65004368569c | 48 | int ax_platform_ping(ax_platform *cloud, ax_deviceID *device); |
AxedaCorp | 0:65004368569c | 49 | int ax_platform_upload(ax_platform *cloud, ax_deviceID *device, ax_file *file); |
AxedaCorp | 0:65004368569c | 50 | int ax_platform_download(ax_platform *cloud, ax_deviceID *device, ax_package_instruction *instr); |
AxedaCorp | 0:65004368569c | 51 | |
AxedaCorp | 0:65004368569c | 52 | int ax_platform_setPkgStatus(ax_platform *cloud, ax_deviceID *device, char *pkgID, int status, char *errorMsg); |
AxedaCorp | 0:65004368569c | 53 | int ax_platform_setPkgStatusStarted(ax_platform *cloud, ax_deviceID *device, char *pkgID); |
AxedaCorp | 0:65004368569c | 54 | int ax_platform_setPkgStatusQueued(ax_platform *cloud, ax_deviceID *device, char *pkgID); |
AxedaCorp | 0:65004368569c | 55 | int ax_platform_setPkgStatusSuccess(ax_platform *cloud, ax_deviceID *device, char *pkgID); |
AxedaCorp | 0:65004368569c | 56 | int ax_platform_setPkgStatusFailed(ax_platform *cloud, ax_deviceID *device, char *pkgID, char *errorMsg); |
AxedaCorp | 0:65004368569c | 57 | /*******************************************************************************************************/ |
AxedaCorp | 0:65004368569c | 58 | /*The following functions are internal only and should never need to be called outside of this library*/ |
AxedaCorp | 0:65004368569c | 59 | /*****************************************************************************************************/ |
AxedaCorp | 0:65004368569c | 60 | char *encodeAgentID(ax_deviceID *device, char *buff); |
AxedaCorp | 0:65004368569c | 61 | char *getResource(char *endPointBuff, ax_deviceID *device, int resourceType); |
AxedaCorp | 0:65004368569c | 62 | char *getDataResource(char *endPointBuff, ax_deviceID *device); |
AxedaCorp | 0:65004368569c | 63 | char *getAgentResource(char *endPointBuff, ax_deviceID *device); |
AxedaCorp | 0:65004368569c | 64 | char *getFileResource(char *endPointBuff, ax_deviceID *device); |
AxedaCorp | 0:65004368569c | 65 | char *getRegistrationResource(char *endPointBuff, ax_deviceID *device); |
AxedaCorp | 0:65004368569c | 66 | char *getFileDownloadResource(char *endPointBuff, ax_deviceID *device, char *fileID); |
AxedaCorp | 0:65004368569c | 67 | char *getPackageUpdateResource(char *endPointBuff, ax_deviceID *device, char *packageID); |
AxedaCorp | 0:65004368569c | 68 | |
AxedaCorp | 0:65004368569c | 69 | char *getContentType(char *contentBuff, int type); |
AxedaCorp | 0:65004368569c | 70 | char *getGeneralType(char *contentBuff); |
AxedaCorp | 0:65004368569c | 71 | |
AxedaCorp | 0:65004368569c | 72 | #ifdef __cplusplus |
AxedaCorp | 0:65004368569c | 73 | } |
AxedaCorp | 0:65004368569c | 74 | #endif |
AxedaCorp | 0:65004368569c | 75 | |
AxedaCorp | 0:65004368569c | 76 | #endif |
AxedaCorp | 0:65004368569c | 77 |