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/axTypes.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 | #ifndef _AXTYPES_H_ |
AxedaCorp | 0:65004368569c | 2 | #define _AXTYPES_H_ |
AxedaCorp | 0:65004368569c | 3 | |
AxedaCorp | 0:65004368569c | 4 | #include "axSettings.h" |
AxedaCorp | 0:65004368569c | 5 | |
AxedaCorp | 0:65004368569c | 6 | |
AxedaCorp | 0:65004368569c | 7 | typedef struct ax_dataNode { |
AxedaCorp | 0:65004368569c | 8 | char name[AX_DN_NAME_S]; |
AxedaCorp | 0:65004368569c | 9 | char sValue[AX_DN_SV_S]; |
AxedaCorp | 0:65004368569c | 10 | double dValue; |
AxedaCorp | 0:65004368569c | 11 | int type; |
AxedaCorp | 0:65004368569c | 12 | struct ax_dataNode* next; |
AxedaCorp | 0:65004368569c | 13 | }ax_dataNode; |
AxedaCorp | 0:65004368569c | 14 | |
AxedaCorp | 0:65004368569c | 15 | typedef struct ax_dataNode axDataNode; |
AxedaCorp | 0:65004368569c | 16 | |
AxedaCorp | 0:65004368569c | 17 | typedef struct { |
AxedaCorp | 0:65004368569c | 18 | int acquisitionTime; |
AxedaCorp | 0:65004368569c | 19 | int priority; |
AxedaCorp | 0:65004368569c | 20 | int created; |
AxedaCorp | 0:65004368569c | 21 | ax_dataNode *data_first; |
AxedaCorp | 0:65004368569c | 22 | ax_dataNode *data_last; |
AxedaCorp | 0:65004368569c | 23 | int dataNode_ct; |
AxedaCorp | 0:65004368569c | 24 | }ax_dataSet; |
AxedaCorp | 0:65004368569c | 25 | |
AxedaCorp | 0:65004368569c | 26 | typedef struct { |
AxedaCorp | 0:65004368569c | 27 | char alarmName[AX_ALM_NAME_S]; |
AxedaCorp | 0:65004368569c | 28 | char alarmDescription[AX_ALM_DESC_S]; |
AxedaCorp | 0:65004368569c | 29 | int alarmSeverity; |
AxedaCorp | 0:65004368569c | 30 | char alarmCause[AX_ALM_CAUSE_S]; |
AxedaCorp | 0:65004368569c | 31 | char alarmReason[AX_ALM_REAS_S]; |
AxedaCorp | 0:65004368569c | 32 | int dateAcquired; |
AxedaCorp | 0:65004368569c | 33 | int priority; |
AxedaCorp | 0:65004368569c | 34 | }ax_alarm; |
AxedaCorp | 0:65004368569c | 35 | |
AxedaCorp | 0:65004368569c | 36 | typedef struct { |
AxedaCorp | 0:65004368569c | 37 | char name[AX_EVT_NAME_S]; |
AxedaCorp | 0:65004368569c | 38 | char description[AX_EVT_DESC_S]; |
AxedaCorp | 0:65004368569c | 39 | int dateAcquired; |
AxedaCorp | 0:65004368569c | 40 | int priority; |
AxedaCorp | 0:65004368569c | 41 | }ax_event; |
AxedaCorp | 0:65004368569c | 42 | |
AxedaCorp | 0:65004368569c | 43 | typedef struct { |
AxedaCorp | 0:65004368569c | 44 | double latitude; |
AxedaCorp | 0:65004368569c | 45 | double longitude; |
AxedaCorp | 0:65004368569c | 46 | double altitude; |
AxedaCorp | 0:65004368569c | 47 | int dateAcquired; |
AxedaCorp | 0:65004368569c | 48 | int priority; |
AxedaCorp | 0:65004368569c | 49 | }ax_location; |
AxedaCorp | 0:65004368569c | 50 | |
AxedaCorp | 0:65004368569c | 51 | typedef struct { |
AxedaCorp | 0:65004368569c | 52 | char deviceId[AX_MSID_DID_S]; //Future expansion |
AxedaCorp | 0:65004368569c | 53 | char model[AX_MSID_MDL_S]; |
AxedaCorp | 0:65004368569c | 54 | char serial[AX_MSID_SER_S]; |
AxedaCorp | 0:65004368569c | 55 | char tenant[AX_MSID_TEN_S]; |
AxedaCorp | 0:65004368569c | 56 | }ax_deviceID; |
AxedaCorp | 0:65004368569c | 57 | |
AxedaCorp | 0:65004368569c | 58 | //TODO: Possibly deprecate the ax_registration domain object which is just a ping rate and deviceID. Enforce it in the method. |
AxedaCorp | 0:65004368569c | 59 | typedef struct { |
AxedaCorp | 0:65004368569c | 60 | ax_deviceID *device; |
AxedaCorp | 0:65004368569c | 61 | int pingRate; |
AxedaCorp | 0:65004368569c | 62 | }ax_registration; |
AxedaCorp | 0:65004368569c | 63 | |
AxedaCorp | 0:65004368569c | 64 | typedef struct { |
AxedaCorp | 0:65004368569c | 65 | char name[AX_FILE_NAME_S]; |
AxedaCorp | 0:65004368569c | 66 | char hint[AX_FILE_HINT_S]; |
AxedaCorp | 0:65004368569c | 67 | int size; |
AxedaCorp | 0:65004368569c | 68 | char fileID[AX_FILE_ID_S]; |
AxedaCorp | 0:65004368569c | 69 | unsigned char *data; //array of bytes/ints/whatever |
AxedaCorp | 0:65004368569c | 70 | //int priority; |
AxedaCorp | 0:65004368569c | 71 | }ax_file; |
AxedaCorp | 0:65004368569c | 72 | |
AxedaCorp | 0:65004368569c | 73 | typedef struct { |
AxedaCorp | 0:65004368569c | 74 | char hostname[AX_PLAT_HOST_S]; |
AxedaCorp | 0:65004368569c | 75 | int ip[4]; |
AxedaCorp | 0:65004368569c | 76 | int online; |
AxedaCorp | 0:65004368569c | 77 | int port; |
AxedaCorp | 0:65004368569c | 78 | int secure; //Use SSL/TLS when talking to the platform. |
AxedaCorp | 0:65004368569c | 79 | int ping_rate; |
AxedaCorp | 0:65004368569c | 80 | int verify; //a flag to verify the SSL/TLS certificate of the platform. The certificate MUST be stored locally and match otherwise the TLS handshake will fail. |
AxedaCorp | 0:65004368569c | 81 | }ax_platform; |
AxedaCorp | 0:65004368569c | 82 | |
AxedaCorp | 0:65004368569c | 83 | typedef struct pkg_inst{ |
AxedaCorp | 0:65004368569c | 84 | int instruction_type; //mapped to the @type |
AxedaCorp | 0:65004368569c | 85 | char file_id[AX_PKGI_FID_S]; |
AxedaCorp | 0:65004368569c | 86 | char path[AX_PKGI_PATH_S]; |
AxedaCorp | 0:65004368569c | 87 | char filename[AX_PKGI_FNAME_S]; |
AxedaCorp | 0:65004368569c | 88 | struct pkg_inst *next; |
AxedaCorp | 0:65004368569c | 89 | }ax_package_instruction; |
AxedaCorp | 0:65004368569c | 90 | |
AxedaCorp | 0:65004368569c | 91 | typedef struct { |
AxedaCorp | 0:65004368569c | 92 | char packageID[AX_PKG_ID_S]; |
AxedaCorp | 0:65004368569c | 93 | ax_package_instruction *instructions; |
AxedaCorp | 0:65004368569c | 94 | int time; |
AxedaCorp | 0:65004368569c | 95 | int priority; |
AxedaCorp | 0:65004368569c | 96 | }ax_package; |
AxedaCorp | 0:65004368569c | 97 | |
AxedaCorp | 0:65004368569c | 98 | |
AxedaCorp | 0:65004368569c | 99 | #endif |
AxedaCorp | 0:65004368569c | 100 |