#include "stdint.h"
#include <stdlib.h>
#include <string.h>
#include "dn_additional.h"
#include "dn_common.h"
#include "dn_device.h"
#include "dn_udp.h"
#include "dn_robotalk.h"
Go to the source code of this file.
Functions | |
uint16_t | rtk_calc_crc (const union RTK_PACKET *packet) |
Calculates CRC of the ROBOTalk packet. More... | |
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. More... | |
HRESULT | rtk_recv (const struct CONN_PARAM_COMMON *device, union RTK_PACKET *packet_recv, int client, unsigned int retry_nak) |
Receives ROBOTalk packet. More... | |
HRESULT | rtk_send (const struct CONN_PARAM_COMMON *device, union RTK_PACKET *packet_send) |
Sends ROBOTalk packet. More... | |
static HRESULT | rtk_send_nak (const struct CONN_PARAM_COMMON *device, uint8_t from_id, uint8_t to_id) |
Sends a NAK packet. More... | |
uint16_t rtk_calc_crc | ( | const union RTK_PACKET * | packet | ) |
Calculates CRC of the ROBOTalk packet.
[in] | packet | The ROBOTalk packet to be calculated. |
Definition at line 118 of file dn_robotalk.c.
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.
[in] | command | The ROBOTalk command. |
[in] | data | The ROBOTalk data. |
[in] | len_data | The length of data. |
[in] | from_id | The id of host. |
[in] | to_id | The id of the target client. |
[out] | packet | The created ROBOTalk packet. |
Definition at line 86 of file dn_robotalk.c.
HRESULT rtk_recv | ( | const struct CONN_PARAM_COMMON * | device, |
union RTK_PACKET * | packet_recv, | ||
int | client, | ||
unsigned int | retry_nak | ||
) |
Receives ROBOTalk packet.
[in] | device | The common communication parameters. |
[out] | packet_recv | The ROBOTalk packet to be received. |
[in] | client | Flag that means the receiver is client(1) or not(0). |
[in] | retry_nak | The retry count when receiving the NAK packet. |
Definition at line 193 of file dn_robotalk.c.
HRESULT rtk_send | ( | const struct CONN_PARAM_COMMON * | device, |
union RTK_PACKET * | packet_send | ||
) |
Sends ROBOTalk packet.
[in] | device | The common communication parameters. |
[in] | packet_send | The ROBOTalk packet to be sent. |
Definition at line 143 of file dn_robotalk.c.
|
static |
Sends a NAK packet.
Software License Agreement (MIT License)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[in] | device | The common communication parameters. |
[in] | frm_id | The id of host. |
[in] | to_id | The id of the target client. |
Definition at line 50 of file dn_robotalk.c.