 |
cMicroOrp
1.0.0
C code for microcontrollers - provides ORP remote interface
|
|
Go to the documentation of this file.
22 #define ORP_PACKET_TYPE_FIELD 0
23 #define ORP_PACKET_STATUS_FIELD 1
24 #define ORP_PACKET_SEGMENT_START_FIELD 2
25 #define ORP_PACKET_CONTENTS_START_FIELD 4
32 #define SBR_PKT_RQST_INPUT_CREATE 'I' // type[1] d_type[1] pad[2] path[] units[]
33 #define SBR_PKT_RESP_INPUT_CREATE 'i' // type[1] status[1] pad[2]
35 #define SBR_PKT_RQST_OUTPUT_CREATE 'O' // type[1] d_type[1] pad[2] path[] units[]
36 #define SBR_PKT_RESP_OUTPUT_CREATE 'o' // type[1] status[1] pad[2]
38 #define SBR_PKT_RQST_DELETE 'D' // type[1] pad[1] pad[2] path[]
39 #define SBR_PKT_RESP_DELETE 'd' // type[1] status[1] pad[2]
41 #define SBR_PKT_RQST_HANDLER_ADD 'H' // type[1] pad[1] pad[2] path[]
42 #define SBR_PKT_RESP_HANDLER_ADD 'h' // type[1] status[1] pad[2]
44 #define SBR_PKT_RQST_HANDLER_REMOVE 'K' // type[1] pad[1] pad[2] path[]
45 #define SBR_PKT_RESP_HANDLER_REMOVE 'k' // type[1] status[1] pad[2]
47 #define SBR_PKT_RQST_PUSH 'P' // type[1] d_type[1] pad[2] time[] path[] data[]
48 #define SBR_PKT_RESP_PUSH 'p' // type[1] status[1] pad[2]
50 #define SBR_PKT_RQST_GET 'G' // type[1] pad[1] pad[2] path[]
51 #define SBR_PKT_RESP_GET 'g' // type[1] status[1] pad[2] time[] data[]
53 #define SBR_PKT_RQST_EXAMPLE_SET 'E' // type[1] d_type[1] pad[2] path[] data[]
54 #define SBR_PKT_RESP_EXAMPLE_SET 'e' // type[1] status[1] pad[2]
56 #define SBR_PKT_RQST_SENSOR_CREATE 'S' // type[1] d_type[1] pad[2] path[] units[]
57 #define SBR_PKT_RESP_SENSOR_CREATE 's' // type[1] status[1] pad[2]
59 #define SBR_PKT_RQST_SENSOR_REMOVE 'R' // type[1] pad[1] pad[2] path[]
60 #define SBR_PKT_RESP_SENSOR_REMOVE 'r' // type[1] status[1] pad[2]
62 #define SBR_PKT_NTFY_HANDLER_CALL 'c' // type[1] d_type[1] pad[2] time[] path[] data[]
63 #define SBR_PKT_RESP_HANDLER_CALL 'C' // type[1] status[1] pad[2]
65 #define SBR_PKT_NTFY_SENSOR_CALL 'b' // type[1] pad[1] pad[2] path[]
66 #define SBR_PKT_RESP_SENSOR_CALL 'B' // type[1] status[1] pad[2]
68 #define SBR_PKT_RESP_UNKNOWN_RQST '?' // type[1] status[1] pad[2]
76 #define SBR_DATA_TYPE_TRIGGER 'T' // trigger - no data
77 #define SBR_DATA_TYPE_BOOLEAN 'B' // Boolean - 1 byte: 't' | 'f'
78 #define SBR_DATA_TYPE_NUMERIC 'N' // numeric - null-terminated ASCII string, representing double
79 #define SBR_DATA_TYPE_STRING 'S' // string - null-terminated ASCII string
80 #define SBR_DATA_TYPE_JSON 'J' // JSON - null-terminated ASCII string, representing JSON
81 #define SBR_DATA_TYPE_UNDEF ' ' // not specified
83 #define OK '@' // weird encoding status value = -1 * (<status byte> - 0x40) ==== 0
123 #define SBR_FIELD_ID_PATH 'P'
124 #define SBR_FIELD_ID_TIME 'T'
125 #define SBR_FIELD_ID_UNITS 'U'
126 #define SBR_FIELD_ID_DATA 'D'
129 #define SBR_VARLENGTH_SEPARATOR ','
181 const uint8_t *buffer,
182 uint16_t bufferLength
188 const uint8_t *buffer,
189 uint16_t bufferLength
194 char * app_orp_inPayload,
195 size_t app_orp_inPayloadSize,
201 uint8_t *hdlc_rx_buffer,
202 uint16_t hdlc_rx_bufferSize,
249 #endif // ORP_PROTOCOL_H
@ STATUS_OK
Definition: orp_protocol.h:93
@ NOT_PERMITTED
Definition: orp_protocol.h:98
@ CLOSED
Definition: orp_protocol.h:109
@ FORMAT_ERROR
Definition: orp_protocol.h:106
@ COMM_ERROR
Definition: orp_protocol.h:100
void(* orp_protocol_genericNotification_cb)(const uint8_t *buffer, uint16_t bufferLength)
Definition: orp_protocol.h:187
@ WOULD_BLOCK
Definition: orp_protocol.h:104
void(* orp_delay100ms_cb)(void)
Definition: orp_protocol.h:136
@ DEADLOCK
Definition: orp_protocol.h:105
@ WAITING_RESPONSE
Definition: orp_protocol.h:116
@ UN_INITIALISED
Definition: orp_protocol.h:117
@ TIMEOUT
Definition: orp_protocol.h:101
@ OVERFLOW
Definition: orp_protocol.h:102
int16_t orp_protocol_pushValue(uint8_t dataType, const char *path, const char *data)
Definition: orp_protocol.c:166
void orp_protocol_processHdlcRx(uint8_t data)
Definition: orp_protocol.c:114
@ FAULT
Definition: orp_protocol.h:99
int16_t orp_protocol_createResource(char packetType, char dataType, const char *path, const char *units)
Definition: orp_protocol.c:126
void(* orp_protocol_genericRequestResponse_cb)(const uint8_t *buffer, uint16_t bufferLength)
Definition: orp_protocol.h:180
@ UNSUPPORTED
Definition: orp_protocol.h:111
orp_responseStatusEnum
Definition: orp_protocol.h:92
@ NOT_FOUND
Definition: orp_protocol.h:94
@ OUT_OF_RANGE
Definition: orp_protocol.h:96
void orp_protocol_wakeup(orp_delay100ms_cb)
Definition: orp_protocol.c:120
@ IO_ERROR
Definition: orp_protocol.h:112
void(* orp_hdlc_tx_cb)(uint8_t)
Definition: orp_protocol.h:135
int16_t orp_protocol_addpushHandler(uint8_t dataType, const char *path)
Definition: orp_protocol.c:190
@ UNDERFLOW
Definition: orp_protocol.h:103
@ NO_MEMORY
Definition: orp_protocol.h:97
@ BUSY
Definition: orp_protocol.h:110
@ BAD_PARAMETER
Definition: orp_protocol.h:108
void orp_protocol(char *app_orp_inPayload, size_t app_orp_inPayloadSize, orp_hdlc_tx_cb tx_char_cbh, uint8_t *hdlc_rx_buffer, uint16_t hdlc_rx_bufferSize, orp_protocol_genericRequestResponse_cb appRequestIn_cbf, orp_protocol_genericNotification_cb appNotificationIn_cbf)
Definition: orp_protocol.c:78
@ TERMINATED
Definition: orp_protocol.h:115
@ DUPLICATE
Definition: orp_protocol.h:107
@ NOT_IMPLEMENTED
Definition: orp_protocol.h:113
@ NOT_POSSIBLE
Definition: orp_protocol.h:95
@ UNAVAILABLE
Definition: orp_protocol.h:114