36 #ifndef _DN_EXP_ROBOTALK 37 #define _DN_EXP_ROBOTALK 45 #define RTK_CHECK_TYPE (CHECK_TYPE_UDP | CHECK_TYPE_COM) 51 #define RTK_CHECK_SEND (RTK_CHECK_TYPE | CHECK_FUNC_SEND) 57 #define RTK_CHECK_RECV (RTK_CHECK_TYPE | CHECK_FUNC_SEND | CHECK_FUNC_RECV) 63 #define RTK_ENQ (0x05) 69 #define RTK_CMD_REJ (0x0E01) 75 #define RTK_CMD_ACK (0x0E02) 81 #define RTK_CMD_NAK (0x0E82) 87 #define RTK_SIZE_PACKET (256) 93 #define RTK_SIZE_HEADER (6) 99 #define RTK_SIZE_DATA (RTK_SIZE_PACKET - RTK_SIZE_HEADER) 105 #define RTK_SIZE_COMMAND (2) 111 #define RTK_SIZE_CRC (2) 117 #define RTK_RETRY_FLAG (0x1000) 123 #define RTK_RETRY_COUNT (0x2000) 129 #define RTK_RETRY_MASK (0xF000) 136 #define NativeCommand(cmd) ((cmd) & ~RTK_RETRY_MASK) 204 union RTK_PACKET *packet_recv,
int client,
unsigned int retry_nak);
_DN_EXP_ROBOTALK HRESULT rtk_param2packet(uint16_t command, const uint8_t *data, uint8_t len_data, uint8_t from_id, uint8_t to_id, union RTK_PACKET *packet)
Creates a ROBOTalk packet.
A type definition for the ROBOTalk packet.
#define RTK_SIZE_DATA
The data buffer size of a ROBOTalk packet.
#define RTK_SIZE_PACKET
The maximum buffer size of a ROBOTalk packet.
_DN_EXP_ROBOTALK uint16_t rtk_calc_crc(const union RTK_PACKET *packet)
Calculates CRC of the ROBOTalk packet.
A type definition for common communication parameters.
uint8_t buf[RTK_SIZE_PACKET]
_DN_EXP_ROBOTALK HRESULT rtk_send(const struct CONN_PARAM_COMMON *device, union RTK_PACKET *packet_send)
Sends ROBOTalk packet.
uint8_t data[RTK_SIZE_DATA]
_DN_EXP_ROBOTALK HRESULT rtk_recv(const struct CONN_PARAM_COMMON *device, union RTK_PACKET *packet_recv, int client, unsigned int retry_nak)
Receives ROBOTalk packet.