22 lines
647 B
C
22 lines
647 B
C
#ifndef NH_HELPER_SERIAL_H
|
|
#define NH_HELPER_SERIAL_H
|
|
|
|
#include "nh_common.h"
|
|
|
|
typedef enum {
|
|
NH_SERIAL_TAG_EP_NAME = 1U,
|
|
NH_SERIAL_TAG_DATA = 2U,
|
|
} nh_serial_tag_t;
|
|
|
|
typedef enum {
|
|
NH_SERIAL_EP_RESP,
|
|
NH_SERIAL_EP_EVENT,
|
|
} nh_serial_ep_type_t;
|
|
|
|
nh_ret_t nh_serial_get_type(nh_serial_ep_type_t *type, uint8_t *buf);
|
|
nh_ret_t nh_serial_get_payload(uint8_t *buf, uint8_t **payload, uint16_t *length);
|
|
nh_ret_t nh_serial_header_length(nh_serial_ep_type_t type, uint16_t *header_length);
|
|
nh_ret_t nh_serial_write_header(nh_serial_ep_type_t type, uint8_t *buf, uint16_t data_len, uint8_t **data_start);
|
|
|
|
#endif // NH_HELPER_SERIAL_H
|