![]() |
MercurySDK
Software development kit for Mercury digital servos
|
The class for control Mercury by using Protocol2.0. More...
#include <protocol2_packet_handler.h>
Public Member Functions | |
virtual | ~Protocol2PacketHandler () |
float | getProtocolVersion () |
The function that returns Protocol version used in Protocol2PacketHandler (2.0) More... | |
const char * | getTxRxResult (int result) |
The function that gets description of communication result. More... | |
const char * | getRxPacketError (uint8_t error) |
The function that gets description of hardware error. More... | |
int | txPacket (PortHandler *port, uint8_t *txpacket) |
The function that transmits the instruction packet txpacket via PortHandler port. @description The function clears the port buffer by PortHandler::clearPort() function, @description then transmits txpacket by PortHandler::writePort() function. @description The function activates only when the port is not busy and when the packet is already written on the port buffer. More... | |
int | rxPacket (PortHandler *port, uint8_t *rxpacket) |
The function that receives packet (rxpacket) during designated time via PortHandler port @description The function repeatedly tries to receive rxpacket by PortHandler::readPort() function. @description It breaks out @description when PortHandler::isPacketTimeout() shows the timeout, @description when rxpacket seemed as corrupted, or @description when nothing received. More... | |
int | txRxPacket (PortHandler *port, uint8_t *txpacket, uint8_t *rxpacket, uint8_t *error=0) |
The function that transmits packet (txpacket) and receives packet (rxpacket) during designated time via PortHandler port @description The function calls Protocol2PacketHandler::txPacket(), @description and calls Protocol2PacketHandler::rxPacket() if it succeeds Protocol2PacketHandler::txPacket(). @description It breaks out @description when it fails Protocol2PacketHandler::txPacket(), @description when txpacket is called by Protocol2PacketHandler::broadcastPing() / Protocol2PacketHandler::syncWriteTxOnly() / Protocol2PacketHandler::regWriteTxOnly / Protocol2PacketHandler::action. More... | |
int | ping (PortHandler *port, uint8_t id, uint8_t *error=0) |
The function that pings Mercury but doesn't take its model number @description The function calls Protocol2PacketHandler::ping() which gets Mercury model number, @description but doesn't carry the model number. More... | |
int | ping (PortHandler *port, uint8_t id, uint16_t *model_number, uint8_t *error=0) |
The function that pings Mercury and takes its model number @description The function makes an instruction packet with INST_PING, @description transmits the packet with Protocol2PacketHandler::txRxPacket(), @description and call Protocol2PacketHandler::readTxRx to read model_number in the rx buffer. @description It breaks out @description when it tries to transmit to BROADCAST_ID. More... | |
int | broadcastPing (PortHandler *port, std::vector< uint8_t > &id_list) |
(Available only in Protocol 2.0) The function that pings all connected Mercury More... | |
int | action (PortHandler *port, uint8_t id) |
The function that makes Mercurys run as written in the Mercury register @description The function makes an instruction packet with INST_ACTION, @description transmits the packet with Protocol2PacketHandler::txRxPacket(). @description To use this function, Mercury register should be set by Protocol2PacketHandler::regWriteTxOnly() or Protocol2PacketHandler::regWriteTxRx() More... | |
int | reboot (PortHandler *port, uint8_t id, uint8_t *error=0) |
The function that makes Mercury reboot @description The function makes an instruction packet with INST_REBOOT, @description transmits the packet with Protocol2PacketHandler::txRxPacket(), @description then Mercury reboots. @description During reboot, its LED will blink. More... | |
int | clearMultiTurn (PortHandler *port, uint8_t id, uint8_t *error=0) |
The function that resets the multi-turn revolution count @description The function makes an instruction packet with INST_CLEAR, @description transmits the packet with Protocol2PacketHandler::txRxPacket(). More... | |
int | factoryReset (PortHandler *port, uint8_t id, uint8_t option, uint8_t *error=0) |
The function that makes Mercury reset as it was produced in the factory @description The function makes an instruction packet with INST_FACTORY_RESET, @description transmits the packet with Protocol2PacketHandler::txRxPacket(). @description Be careful of the use. More... | |
int | readTx (PortHandler *port, uint8_t id, uint16_t address, uint16_t length) |
The function that transmits INST_READ instruction packet @description The function makes an instruction packet with INST_READ, @description transmits the packet with Protocol2PacketHandler::txPacket(). @description It breaks out @description when it tries to transmit to BROADCAST_ID. More... | |
int | readRx (PortHandler *port, uint8_t id, uint16_t length, uint8_t *data, uint8_t *error=0) |
The function that receives the packet and reads the data in the packet @description The function receives the packet which might be come by previous INST_READ instruction packet transmission, @description gets the data from the packet. More... | |
int | readTxRx (PortHandler *port, uint8_t id, uint16_t address, uint16_t length, uint8_t *data, uint8_t *error=0) |
The function that transmits INST_READ instruction packet, and read data from received packet @description The function makes an instruction packet with INST_READ, @description transmits and receives the packet with Protocol2PacketHandler::txRxPacket(), @description gets the data from the packet. @description It breaks out @description when it tries to transmit to BROADCAST_ID. More... | |
int | read1ByteTx (PortHandler *port, uint8_t id, uint16_t address) |
The function that calls Protocol2PacketHandler::readTx() function for reading 1 byte data @description The function calls Protocol2PacketHandler::readTx() function for reading 1 byte data. More... | |
int | read1ByteRx (PortHandler *port, uint8_t id, uint8_t *data, uint8_t *error=0) |
The function that calls Protocol2PacketHandler::readRx() function and reads 1 byte data on the packet @description The function calls Protocol2PacketHandler::readRx() function, @description gets 1 byte data from the packet. More... | |
int | read1ByteTxRx (PortHandler *port, uint8_t id, uint16_t address, uint8_t *data, uint8_t *error=0) |
The function that calls Protocol2PacketHandler::readTxRx() function for reading 1 byte data @description The function calls Protocol2PacketHandler::readTxRx(), @description gets 1 byte data from the packet. More... | |
int | read2ByteTx (PortHandler *port, uint8_t id, uint16_t address) |
The function that calls Protocol2PacketHandler::readTx() function for reading 2 byte data @description The function calls Protocol2PacketHandler::readTx() function for reading 2 byte data. More... | |
int | read2ByteRx (PortHandler *port, uint8_t id, uint16_t *data, uint8_t *error=0) |
The function that calls Protocol2PacketHandler::readRx() function and reads 2 byte data on the packet @description The function calls Protocol2PacketHandler::readRx() function, @description gets 2 byte data from the packet. More... | |
int | read2ByteTxRx (PortHandler *port, uint8_t id, uint16_t address, uint16_t *data, uint8_t *error=0) |
The function that calls Protocol2PacketHandler::readTxRx() function for reading 2 byte data @description The function calls Protocol2PacketHandler::readTxRx(), @description gets 2 byte data from the packet. More... | |
int | read4ByteTx (PortHandler *port, uint8_t id, uint16_t address) |
The function that calls Protocol2PacketHandler::readTx() function for reading 4 byte data @description The function calls Protocol2PacketHandler::readTx() function for reading 4 byte data. More... | |
int | read4ByteRx (PortHandler *port, uint8_t id, uint32_t *data, uint8_t *error=0) |
The function that calls Protocol2PacketHandler::readRx() function and reads 4 byte data on the packet @description The function calls Protocol2PacketHandler::readRx() function, @description gets 4 byte data from the packet. More... | |
int | read4ByteTxRx (PortHandler *port, uint8_t id, uint16_t address, uint32_t *data, uint8_t *error=0) |
The function that calls Protocol2PacketHandler::readTxRx() function for reading 4 byte data @description The function calls Protocol2PacketHandler::readTxRx(), @description gets 4 byte data from the packet. More... | |
int | writeTxOnly (PortHandler *port, uint8_t id, uint16_t address, uint16_t length, uint8_t *data) |
The function that transmits INST_WRITE instruction packet with the data for write @description The function makes an instruction packet with INST_WRITE and the data for write, @description transmits the packet with Protocol2PacketHandler::txPacket(). More... | |
int | writeTxRx (PortHandler *port, uint8_t id, uint16_t address, uint16_t length, uint8_t *data, uint8_t *error=0) |
The function that transmits INST_WRITE instruction packet with the data for write, and receives the packet @description The function makes an instruction packet with INST_WRITE and the data for write, @description transmits and receives the packet with Protocol2PacketHandler::txRxPacket(), @description gets the error from the packet. More... | |
int | write1ByteTxOnly (PortHandler *port, uint8_t id, uint16_t address, uint8_t data) |
The function that calls Protocol2PacketHandler::writeTxOnly() for writing 1 byte data @description The function calls Protocol2PacketHandler::writeTxOnly() for writing 1 byte data. More... | |
int | write1ByteTxRx (PortHandler *port, uint8_t id, uint16_t address, uint8_t data, uint8_t *error=0) |
The function that calls Protocol2PacketHandler::writeTxRx() for writing 1 byte data and receives the packet @description The function calls Protocol2PacketHandler::writeTxRx() for writing 1 byte data and receves the packet, @description gets the error from the packet. More... | |
int | write2ByteTxOnly (PortHandler *port, uint8_t id, uint16_t address, uint16_t data) |
The function that calls Protocol2PacketHandler::writeTxOnly() for writing 2 byte data @description The function calls Protocol2PacketHandler::writeTxOnly() for writing 2 byte data. More... | |
int | write2ByteTxRx (PortHandler *port, uint8_t id, uint16_t address, uint16_t data, uint8_t *error=0) |
The function that calls Protocol2PacketHandler::writeTxRx() for writing 2 byte data and receives the packet @description The function calls Protocol2PacketHandler::writeTxRx() for writing 2 byte data and receves the packet, @description gets the error from the packet. More... | |
int | write4ByteTxOnly (PortHandler *port, uint8_t id, uint16_t address, uint32_t data) |
The function that calls Protocol2PacketHandler::writeTxOnly() for writing 4 byte data @description The function calls Protocol2PacketHandler::writeTxOnly() for writing 4 byte data. More... | |
int | write4ByteTxRx (PortHandler *port, uint8_t id, uint16_t address, uint32_t data, uint8_t *error=0) |
The function that calls Protocol2PacketHandler::writeTxRx() for writing 4 byte data and receives the packet @description The function calls Protocol2PacketHandler::writeTxRx() for writing 4 byte data and receves the packet, @description gets the error from the packet. More... | |
int | regWriteTxOnly (PortHandler *port, uint8_t id, uint16_t address, uint16_t length, uint8_t *data) |
The function that transmits INST_REG_WRITE instruction packet with the data for writing on the Mercury register @description The function makes an instruction packet with INST_REG_WRITE and the data for writing on the Mercury register, @description transmits the packet with Protocol2PacketHandler::txPacket(). @description The data written in the register will act when INST_ACTION instruction packet is transmitted to the Mercury. More... | |
int | regWriteTxRx (PortHandler *port, uint8_t id, uint16_t address, uint16_t length, uint8_t *data, uint8_t *error=0) |
The function that transmits INST_REG_WRITE instruction packet with the data for writing on the Mercury register, and receives the packet @description The function makes an instruction packet with INST_REG_WRITE and the data for writing on the Mercury register, @description transmits and receives the packet with Protocol2PacketHandler::txRxPacket(), @description gets the error from the packet. @description The data written in the register will act when INST_ACTION instruction packet is transmitted to the Mercury. More... | |
int | syncReadTx (PortHandler *port, uint16_t start_address, uint16_t data_length, uint8_t *param, uint16_t param_length) |
The function that transmits INST_SYNC_READ instruction packet @description The function makes an instruction packet with INST_SYNC_READ, @description transmits the packet with Protocol2PacketHandler::txPacket(). More... | |
int | syncWriteTxOnly (PortHandler *port, uint16_t start_address, uint16_t data_length, uint8_t *param, uint16_t param_length) |
The function that transmits INST_SYNC_WRITE instruction packet @description The function makes an instruction packet with INST_SYNC_WRITE, @description transmits the packet with Protocol2PacketHandler::txRxPacket(). More... | |
int | synchronise (PortHandler *port, uint8_t id, uint8_t *error) |
The function that synchronises the servo @description This function will synchronise the target Mercury servo. @description transmits the packet with PacketHandler::txRxPacket(). More... | |
![]() | |
virtual | ~PacketHandler () |
Static Public Member Functions | |
static Protocol2PacketHandler * | getInstance () |
The function that returns Protocol2PacketHandler instance. More... | |
![]() | |
static PacketHandler * | getPacketHandler () |
The function that returns PacketHandler instance. More... | |
Additional Inherited Members | |
![]() | |
PacketHandler () | |
The class for control Mercury by using Protocol2.0.
Definition at line 37 of file protocol2_packet_handler.h.
|
inlinevirtual |
Definition at line 55 of file protocol2_packet_handler.h.
|
virtual |
The function that makes Mercurys run as written in the Mercury register @description The function makes an instruction packet with INST_ACTION, @description transmits the packet with Protocol2PacketHandler::txRxPacket(). @description To use this function, Mercury register should be set by Protocol2PacketHandler::regWriteTxOnly() or Protocol2PacketHandler::regWriteTxRx()
port | PortHandler instance |
id | Mercury ID |
Implements mercury::PacketHandler.
Definition at line 591 of file protocol2_packet_handler.cpp.
|
virtual |
(Available only in Protocol 2.0) The function that pings all connected Mercury
port | PortHandler instance |
id_list | ID list of Mercurys which are found by broadcast ping |
Implements mercury::PacketHandler.
Definition at line 495 of file protocol2_packet_handler.cpp.
|
virtual |
The function that resets the multi-turn revolution count @description The function makes an instruction packet with INST_CLEAR, @description transmits the packet with Protocol2PacketHandler::txRxPacket().
port | PortHandler instance |
id | Mercury ID |
error | Mercury hardware error or Result Fail (0x01) or 0 (success) |
Implements mercury::PacketHandler.
Definition at line 616 of file protocol2_packet_handler.cpp.
|
virtual |
The function that makes Mercury reset as it was produced in the factory @description The function makes an instruction packet with INST_FACTORY_RESET, @description transmits the packet with Protocol2PacketHandler::txRxPacket(). @description Be careful of the use.
port | PortHandler instance |
id | Mercury ID |
option | Reset option (0xFF for reset all values / 0x01 for reset all values except ID / 0x02 for reset all values except ID and Baudrate) |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 634 of file protocol2_packet_handler.cpp.
|
inlinestatic |
The function that returns Protocol2PacketHandler instance.
Definition at line 53 of file protocol2_packet_handler.h.
|
inlinevirtual |
The function that returns Protocol version used in Protocol2PacketHandler (2.0)
Implements mercury::PacketHandler.
Definition at line 61 of file protocol2_packet_handler.h.
|
virtual |
The function that gets description of hardware error.
error | Mercury hardware error which might be gotten by the tx rx functions |
Implements mercury::PacketHandler.
Definition at line 110 of file protocol2_packet_handler.cpp.
|
virtual |
The function that gets description of communication result.
result | Communication result which might be gotten by the tx rx functions |
Implements mercury::PacketHandler.
Definition at line 74 of file protocol2_packet_handler.cpp.
|
virtual |
The function that pings Mercury and takes its model number @description The function makes an instruction packet with INST_PING, @description transmits the packet with Protocol2PacketHandler::txRxPacket(), @description and call Protocol2PacketHandler::readTxRx to read model_number in the rx buffer. @description It breaks out @description when it tries to transmit to BROADCAST_ID.
port | PortHandler instance |
id | Mercury ID |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 473 of file protocol2_packet_handler.cpp.
|
virtual |
The function that pings Mercury but doesn't take its model number @description The function calls Protocol2PacketHandler::ping() which gets Mercury model number, @description but doesn't carry the model number.
port | PortHandler instance |
id | Mercury ID |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 468 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::readRx() function and reads 1 byte data on the packet @description The function calls Protocol2PacketHandler::readRx() function, @description gets 1 byte data from the packet.
port | PortHandler instance |
data | Data extracted from the packet |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 747 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::readTx() function for reading 1 byte data @description The function calls Protocol2PacketHandler::readTx() function for reading 1 byte data.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for read |
Implements mercury::PacketHandler.
Definition at line 743 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::readTxRx() function for reading 1 byte data @description The function calls Protocol2PacketHandler::readTxRx(), @description gets 1 byte data from the packet.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for read |
length | Length of the data for read |
data | Data extracted from the packet |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 755 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::readRx() function and reads 2 byte data on the packet @description The function calls Protocol2PacketHandler::readRx() function, @description gets 2 byte data from the packet.
port | PortHandler instance |
data | Data extracted from the packet |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 768 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::readTx() function for reading 2 byte data @description The function calls Protocol2PacketHandler::readTx() function for reading 2 byte data.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for read |
Implements mercury::PacketHandler.
Definition at line 764 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::readTxRx() function for reading 2 byte data @description The function calls Protocol2PacketHandler::readTxRx(), @description gets 2 byte data from the packet.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for read |
length | Length of the data for read |
data | Data extracted from the packet |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 776 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::readRx() function and reads 4 byte data on the packet @description The function calls Protocol2PacketHandler::readRx() function, @description gets 4 byte data from the packet.
port | PortHandler instance |
data | Data extracted from the packet |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 789 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::readTx() function for reading 4 byte data @description The function calls Protocol2PacketHandler::readTx() function for reading 4 byte data.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for read |
Implements mercury::PacketHandler.
Definition at line 785 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::readTxRx() function for reading 4 byte data @description The function calls Protocol2PacketHandler::readTxRx(), @description gets 4 byte data from the packet.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for read |
length | Length of the data for read |
data | Data extracted from the packet |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 797 of file protocol2_packet_handler.cpp.
|
virtual |
The function that receives the packet and reads the data in the packet @description The function receives the packet which might be come by previous INST_READ instruction packet transmission, @description gets the data from the packet.
port | PortHandler instance |
length | Length of the data for read |
data | Data extracted from the packet |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 675 of file protocol2_packet_handler.cpp.
|
virtual |
The function that transmits INST_READ instruction packet @description The function makes an instruction packet with INST_READ, @description transmits the packet with Protocol2PacketHandler::txPacket(). @description It breaks out @description when it tries to transmit to BROADCAST_ID.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for read |
length | Length of the data for read |
Implements mercury::PacketHandler.
Definition at line 648 of file protocol2_packet_handler.cpp.
|
virtual |
The function that transmits INST_READ instruction packet, and read data from received packet @description The function makes an instruction packet with INST_READ, @description transmits and receives the packet with Protocol2PacketHandler::txRxPacket(), @description gets the data from the packet. @description It breaks out @description when it tries to transmit to BROADCAST_ID.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for read |
length | Length of the data for read |
data | Data extracted from the packet |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 702 of file protocol2_packet_handler.cpp.
|
virtual |
The function that makes Mercury reboot @description The function makes an instruction packet with INST_REBOOT, @description transmits the packet with Protocol2PacketHandler::txRxPacket(), @description then Mercury reboots. @description During reboot, its LED will blink.
port | PortHandler instance |
id | Mercury ID |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 603 of file protocol2_packet_handler.cpp.
|
virtual |
The function that transmits INST_REG_WRITE instruction packet with the data for writing on the Mercury register @description The function makes an instruction packet with INST_REG_WRITE and the data for writing on the Mercury register, @description transmits the packet with Protocol2PacketHandler::txPacket(). @description The data written in the register will act when INST_ACTION instruction packet is transmitted to the Mercury.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for write |
length | Length of the data for write |
data | Data for write |
Implements mercury::PacketHandler.
Definition at line 891 of file protocol2_packet_handler.cpp.
|
virtual |
The function that transmits INST_REG_WRITE instruction packet with the data for writing on the Mercury register, and receives the packet @description The function makes an instruction packet with INST_REG_WRITE and the data for writing on the Mercury register, @description transmits and receives the packet with Protocol2PacketHandler::txRxPacket(), @description gets the error from the packet. @description The data written in the register will act when INST_ACTION instruction packet is transmitted to the Mercury.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for write |
length | Length of the data for write |
data | Data for write |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 917 of file protocol2_packet_handler.cpp.
|
virtual |
The function that receives packet (rxpacket) during designated time via PortHandler port @description The function repeatedly tries to receive rxpacket by PortHandler::readPort() function. @description It breaks out @description when PortHandler::isPacketTimeout() shows the timeout, @description when rxpacket seemed as corrupted, or @description when nothing received.
port | PortHandler instance |
rxpacket | received packet |
Implements mercury::PacketHandler.
Definition at line 312 of file protocol2_packet_handler.cpp.
|
virtual |
The function that synchronises the servo @description This function will synchronise the target Mercury servo. @description transmits the packet with PacketHandler::txRxPacket().
port | PortHandler instance |
id | Mercury ID |
force | synchronisation |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 1000 of file protocol2_packet_handler.cpp.
|
virtual |
The function that transmits INST_SYNC_READ instruction packet @description The function makes an instruction packet with INST_SYNC_READ, @description transmits the packet with Protocol2PacketHandler::txPacket().
port | PortHandler instance |
start_address | Address of the data for Sync Read |
data_length | Length of the data for Sync Read |
param | Parameter for Sync Read |
param_length | Length of the data for Sync Read |
Implements mercury::PacketHandler.
Definition at line 943 of file protocol2_packet_handler.cpp.
|
virtual |
The function that transmits INST_SYNC_WRITE instruction packet @description The function makes an instruction packet with INST_SYNC_WRITE, @description transmits the packet with Protocol2PacketHandler::txRxPacket().
port | PortHandler instance |
start_address | Address of the data for Sync Write |
data_length | Length of the data for Sync Write |
param | Parameter for Sync Write {ID1, DATA0, DATA1, ..., DATAn, ID2, DATA0, DATA1, ..., DATAn, ID3, DATA0, DATA1, ..., DATAn} |
param_length | Length of the data for Sync Write |
Implements mercury::PacketHandler.
Definition at line 973 of file protocol2_packet_handler.cpp.
|
virtual |
The function that transmits the instruction packet txpacket via PortHandler port. @description The function clears the port buffer by PortHandler::clearPort() function, @description then transmits txpacket by PortHandler::writePort() function. @description The function activates only when the port is not busy and when the packet is already written on the port buffer.
port | PortHandler instance |
txpacket | packet for transmission |
Implements mercury::PacketHandler.
Definition at line 268 of file protocol2_packet_handler.cpp.
|
virtual |
The function that transmits packet (txpacket) and receives packet (rxpacket) during designated time via PortHandler port @description The function calls Protocol2PacketHandler::txPacket(), @description and calls Protocol2PacketHandler::rxPacket() if it succeeds Protocol2PacketHandler::txPacket(). @description It breaks out @description when it fails Protocol2PacketHandler::txPacket(), @description when txpacket is called by Protocol2PacketHandler::broadcastPing() / Protocol2PacketHandler::syncWriteTxOnly() / Protocol2PacketHandler::regWriteTxOnly / Protocol2PacketHandler::action.
port | PortHandler instance |
txpacket | packet for transmission |
rxpacket | received packet |
Implements mercury::PacketHandler.
Definition at line 428 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::writeTxOnly() for writing 1 byte data @description The function calls Protocol2PacketHandler::writeTxOnly() for writing 1 byte data.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for write |
data | Data for write |
Implements mercury::PacketHandler.
Definition at line 858 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::writeTxRx() for writing 1 byte data and receives the packet @description The function calls Protocol2PacketHandler::writeTxRx() for writing 1 byte data and receves the packet, @description gets the error from the packet.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for write |
data | Data for write |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 863 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::writeTxOnly() for writing 2 byte data @description The function calls Protocol2PacketHandler::writeTxOnly() for writing 2 byte data.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for write |
data | Data for write |
Implements mercury::PacketHandler.
Definition at line 869 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::writeTxRx() for writing 2 byte data and receives the packet @description The function calls Protocol2PacketHandler::writeTxRx() for writing 2 byte data and receves the packet, @description gets the error from the packet.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for write |
data | Data for write |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 874 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::writeTxOnly() for writing 4 byte data @description The function calls Protocol2PacketHandler::writeTxOnly() for writing 4 byte data.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for write |
data | Data for write |
Implements mercury::PacketHandler.
Definition at line 880 of file protocol2_packet_handler.cpp.
|
virtual |
The function that calls Protocol2PacketHandler::writeTxRx() for writing 4 byte data and receives the packet @description The function calls Protocol2PacketHandler::writeTxRx() for writing 4 byte data and receves the packet, @description gets the error from the packet.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for write |
data | Data for write |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 885 of file protocol2_packet_handler.cpp.
|
virtual |
The function that transmits INST_WRITE instruction packet with the data for write @description The function makes an instruction packet with INST_WRITE and the data for write, @description transmits the packet with Protocol2PacketHandler::txPacket().
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for write |
length | Length of the data for write |
data | Data for write |
Implements mercury::PacketHandler.
Definition at line 806 of file protocol2_packet_handler.cpp.
|
virtual |
The function that transmits INST_WRITE instruction packet with the data for write, and receives the packet @description The function makes an instruction packet with INST_WRITE and the data for write, @description transmits and receives the packet with Protocol2PacketHandler::txRxPacket(), @description gets the error from the packet.
port | PortHandler instance |
id | Mercury ID |
address | Address of the data for write |
length | Length of the data for write |
data | Data for write |
error | Mercury hardware error |
Implements mercury::PacketHandler.
Definition at line 832 of file protocol2_packet_handler.cpp.