RUI3 (RAK Unified Interface 3) - RAK4631
RAKProtocol.h
Go to the documentation of this file.
1 #ifndef __RAKPROTOCOL_H__
2 #define __RAKPROTOCOL_H__
3 
4 #include <stdint.h>
5 
6 typedef enum
7 {
8  RAK_SERIAL_UART0 = 0, // Use UART0 for I/O
9  RAK_SERIAL_UART1, // Use UART1 for I/O
10  RAK_SERIAL_UART2, // Use UART2 for I/O
11 #ifdef SUPPORT_USB
12  RAK_SERIAL_USB0, // Use USB0 for I/O
13 #endif
14 #ifdef SUPPORT_BLE
15  RAK_SERIAL_BLE0, // Use BLE for I/O
16 #endif
19 
20 typedef void (*RAK_PROTO_HANDLER)(int, uint8_t *, uint16_t);
21 
22 class RAKProtocol {
23  private:
24 
25  public:
26  RAKProtocol();
27 
64  void send(RAK_SERIAL_PORT port, uint8_t flag, uint8_t frame_type,
65  uint8_t * payload, uint16_t length,
66  RAK_PROTO_HANDLER response_handler);
67 
79  int32_t registerHandler(uint8_t frame_type,
80  RAK_PROTO_HANDLER request_handler);
81 
92  int32_t deregisterHandler(uint8_t frame_type);
93 };
94 
95 #endif // __RAKPROTOCOL_H__
Definition: RAKProtocol.h:10
Definition: RAKProtocol.h:9
Definition: RAKProtocol.h:22
uint8_t flag
Definition: RAKProtocol.h:73
RAK_SERIAL_PORT
Definition: RAKProtocol.h:6
Definition: RAKProtocol.h:15
int32_t deregisterHandler(uint8_t frame_type)
uint16_t length
Definition: RAKProtocol.h:71
uint8_t frame_type
Definition: RAKProtocol.h:72
int32_t registerHandler(uint8_t frame_type, RAK_PROTO_HANDLER request_handler)
Definition: RAKProtocol.h:17
Definition: RAKProtocol.h:8
void send(RAK_SERIAL_PORT port, uint8_t flag, uint8_t frame_type, uint8_t *payload, uint16_t length, RAK_PROTO_HANDLER response_handler)
void(* RAK_PROTO_HANDLER)(int, uint8_t *, uint16_t)
Definition: RAKProtocol.h:20