MercurySDK
Software development kit for Mercury digital servos
Public Member Functions | List of all members
mercury::GroupSyncWrite Class Reference

The class for writing multiple Dynamixel data from same address with same length at once. More...

#include <group_sync_write.h>

Inheritance diagram for mercury::GroupSyncWrite:
mercury::GroupHandler

Public Member Functions

 GroupSyncWrite (PortHandler *port, PacketHandler *ph, uint16_t start_address, uint16_t data_length)
 The function that Initializes instance for Sync Write. More...
 
 ~GroupSyncWrite ()
 The function that calls clearParam function to clear the parameter list for Sync Write. More...
 
bool addParam (uint8_t id, uint8_t *data)
 The function that adds id, start_address, data_length to the Sync Write list. More...
 
void removeParam (uint8_t id)
 The function that removes id from the Sync Write list. More...
 
bool changeParam (uint8_t id, uint8_t *data)
 The function that changes the data for write in id -> start_address -> data_length to the Sync Write list. More...
 
void clearParam ()
 The function that clears the Sync Write list. More...
 
int txPacket ()
 The function that transmits the Sync Write instruction packet which might be constructed by GroupSyncWrite::addParam function. More...
 
- Public Member Functions inherited from mercury::GroupHandler
 GroupHandler (PortHandler *port, PacketHandler *ph)
 
PortHandlergetPortHandler ()
 
PacketHandlergetPacketHandler ()
 

Additional Inherited Members

- Protected Attributes inherited from mercury::GroupHandler
PortHandlerport_
 
PacketHandlerph_
 
std::vector< uint8_t > id_list_
 
std::map< uint8_t, uint8_t * > data_list_
 
bool is_param_changed_
 
uint8_t * param_
 

Detailed Description

The class for writing multiple Dynamixel data from same address with same length at once.

Definition at line 36 of file group_sync_write.h.

Constructor & Destructor Documentation

◆ GroupSyncWrite()

GroupSyncWrite::GroupSyncWrite ( PortHandler port,
PacketHandler ph,
uint16_t  start_address,
uint16_t  data_length 
)

The function that Initializes instance for Sync Write.

Parameters
portPortHandler instance
phPacketHandler instance
start_addressAddress of the data for write
data_lengthLength of the data for write

Definition at line 34 of file group_sync_write.cpp.

◆ ~GroupSyncWrite()

mercury::GroupSyncWrite::~GroupSyncWrite ( )
inline

The function that calls clearParam function to clear the parameter list for Sync Write.

Definition at line 57 of file group_sync_write.h.

Member Function Documentation

◆ addParam()

bool GroupSyncWrite::addParam ( uint8_t  id,
uint8_t *  data 
)

The function that adds id, start_address, data_length to the Sync Write list.

Parameters
idDynamixel ID
dataData for write
Returns
false
when the ID exists already in the list
or true

Definition at line 65 of file group_sync_write.cpp.

◆ changeParam()

bool GroupSyncWrite::changeParam ( uint8_t  id,
uint8_t *  data 
)

The function that changes the data for write in id -> start_address -> data_length to the Sync Write list.

Parameters
idDynamixel ID
datafor replacement
Returns
false
when the ID doesn't exist in the list
or true

Definition at line 92 of file group_sync_write.cpp.

◆ clearParam()

void GroupSyncWrite::clearParam ( )

The function that clears the Sync Write list.

Definition at line 107 of file group_sync_write.cpp.

◆ removeParam()

void GroupSyncWrite::removeParam ( uint8_t  id)

The function that removes id from the Sync Write list.

Parameters
idDynamixel ID

Definition at line 79 of file group_sync_write.cpp.

◆ txPacket()

int GroupSyncWrite::txPacket ( )

The function that transmits the Sync Write instruction packet which might be constructed by GroupSyncWrite::addParam function.

Returns
COMM_NOT_AVAILABLE
when the list for Sync Write is empty
or the other communication results which come from PacketHandler::syncWriteTxOnly

Definition at line 122 of file group_sync_write.cpp.


The documentation for this class was generated from the following files: