dn_robotalk.h
Go to the documentation of this file.
1 #ifndef DN_ROBOTALK_H_
2 #define DN_ROBOTALK_H_
3 
36 #ifndef _DN_EXP_ROBOTALK
37 #define _DN_EXP_ROBOTALK
38 #endif /* _DN_EXP_ROBOTALK */
39 
45 #define RTK_CHECK_TYPE (CHECK_TYPE_UDP | CHECK_TYPE_COM)
46 
51 #define RTK_CHECK_SEND (RTK_CHECK_TYPE | CHECK_FUNC_SEND)
52 
57 #define RTK_CHECK_RECV (RTK_CHECK_TYPE | CHECK_FUNC_SEND | CHECK_FUNC_RECV)
58 
63 #define RTK_ENQ (0x05)
64 
69 #define RTK_CMD_REJ (0x0E01)
70 
75 #define RTK_CMD_ACK (0x0E02)
76 
81 #define RTK_CMD_NAK (0x0E82)
82 
87 #define RTK_SIZE_PACKET (256)
88 
93 #define RTK_SIZE_HEADER (6)
94 
99 #define RTK_SIZE_DATA (RTK_SIZE_PACKET - RTK_SIZE_HEADER)
100 
105 #define RTK_SIZE_COMMAND (2)
106 
111 #define RTK_SIZE_CRC (2)
112 
117 #define RTK_RETRY_FLAG (0x1000)
118 
123 #define RTK_RETRY_COUNT (0x2000)
124 
129 #define RTK_RETRY_MASK (0xF000)
130 
136 #define NativeCommand(cmd) ((cmd) & ~RTK_RETRY_MASK)
137 
144 {
145  struct
146  {
153  };
155 };
156 
157 #ifdef __cplusplus
158 extern "C"
159 {
160 #endif
161 
174  uint8_t from_id, uint8_t to_id, union RTK_PACKET *packet);
175 
182  rtk_calc_crc(const union RTK_PACKET *packet);
183 
191  rtk_send(const struct CONN_PARAM_COMMON *device,
192  union RTK_PACKET *packet_send);
193 
203  rtk_recv(const struct CONN_PARAM_COMMON *device,
204  union RTK_PACKET *packet_recv, int client, unsigned int retry_nak);
205 
206 #ifdef __cplusplus
207 }
208 #endif
209 
210 #endif /* DN_ROBOTALK_H_ */
_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.
Definition: dn_robotalk.c:86
A type definition for the ROBOTalk packet.
Definition: dn_robotalk.h:143
uint8_t len
Definition: dn_robotalk.h:148
#define RTK_SIZE_DATA
The data buffer size of a ROBOTalk packet.
Definition: dn_robotalk.h:99
unsigned short uint16_t
Definition: stdint.h:41
unsigned char uint8_t
Definition: stdint.h:39
#define RTK_SIZE_PACKET
The maximum buffer size of a ROBOTalk packet.
Definition: dn_robotalk.h:87
int32_t HRESULT
Definition: dn_common.h:61
uint8_t enq
Definition: dn_robotalk.h:147
uint16_t command
Definition: dn_robotalk.h:149
_DN_EXP_ROBOTALK uint16_t rtk_calc_crc(const union RTK_PACKET *packet)
Calculates CRC of the ROBOTalk packet.
Definition: dn_robotalk.c:118
A type definition for common communication parameters.
Definition: dn_device.h:170
uint8_t buf[RTK_SIZE_PACKET]
Definition: dn_robotalk.h:154
uint8_t from_id
Definition: dn_robotalk.h:150
_DN_EXP_ROBOTALK HRESULT rtk_send(const struct CONN_PARAM_COMMON *device, union RTK_PACKET *packet_send)
Sends ROBOTalk packet.
Definition: dn_robotalk.c:143
uint8_t to_id
Definition: dn_robotalk.h:151
uint8_t data[RTK_SIZE_DATA]
Definition: dn_robotalk.h:152
#define _DN_EXP_ROBOTALK
Definition: dn_robotalk.h:37
_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.
Definition: dn_robotalk.c:193


bcap_core
Author(s): DENSO WAVE INCORPORATED
autogenerated on Mon Jun 10 2019 13:12:20