Public Member Functions | Private Member Functions | Private Attributes | List of all members
dynamixel::GroupSyncWrite Class Reference

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

#include <group_sync_write.h>

Public Member Functions

bool addParam (uint8_t id, uint8_t *data)
 The function that adds id, start_address, data_length to 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...
 
PacketHandlergetPacketHandler ()
 The function that returns PacketHandler instance. More...
 
PortHandlergetPortHandler ()
 The function that returns PortHandler instance. More...
 
 GroupSyncWrite (PortHandler *port, PacketHandler *ph, uint16_t start_address, uint16_t data_length)
 The function that Initializes instance for Sync Write. More...
 
void removeParam (uint8_t id)
 The function that removes id from 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...
 
 ~GroupSyncWrite ()
 The function that calls clearParam function to clear the parameter list for Sync Write. More...
 

Private Member Functions

void makeParam ()
 

Private Attributes

uint16_t data_length_
 
std::map< uint8_t, uint8_t * > data_list_
 
std::vector< uint8_t > id_list_
 
bool is_param_changed_
 
uint8_t * param_
 
PacketHandlerph_
 
PortHandlerport_
 
uint16_t start_address_
 

Detailed Description

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

Definition at line 37 of file group_sync_write.h.

Constructor & Destructor Documentation

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.

dynamixel::GroupSyncWrite::~GroupSyncWrite ( )
inline

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

Definition at line 67 of file group_sync_write.h.

Member Function Documentation

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 68 of file group_sync_write.cpp.

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 95 of file group_sync_write.cpp.

void GroupSyncWrite::clearParam ( )

The function that clears the Sync Write list.

Definition at line 110 of file group_sync_write.cpp.

PacketHandler* dynamixel::GroupSyncWrite::getPacketHandler ( )
inline

The function that returns PacketHandler instance.

Returns
PacketHandler instance

Definition at line 79 of file group_sync_write.h.

PortHandler* dynamixel::GroupSyncWrite::getPortHandler ( )
inline

The function that returns PortHandler instance.

Returns
PortHandler instance

Definition at line 73 of file group_sync_write.h.

void GroupSyncWrite::makeParam ( )
private

Definition at line 45 of file group_sync_write.cpp.

void GroupSyncWrite::removeParam ( uint8_t  id)

The function that removes id from the Sync Write list.

Parameters
idDynamixel ID

Definition at line 82 of file group_sync_write.cpp.

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 125 of file group_sync_write.cpp.

Member Data Documentation

uint16_t dynamixel::GroupSyncWrite::data_length_
private

Definition at line 50 of file group_sync_write.h.

std::map<uint8_t, uint8_t* > dynamixel::GroupSyncWrite::data_list_
private

Definition at line 44 of file group_sync_write.h.

std::vector<uint8_t> dynamixel::GroupSyncWrite::id_list_
private

Definition at line 43 of file group_sync_write.h.

bool dynamixel::GroupSyncWrite::is_param_changed_
private

Definition at line 46 of file group_sync_write.h.

uint8_t* dynamixel::GroupSyncWrite::param_
private

Definition at line 48 of file group_sync_write.h.

PacketHandler* dynamixel::GroupSyncWrite::ph_
private

Definition at line 41 of file group_sync_write.h.

PortHandler* dynamixel::GroupSyncWrite::port_
private

Definition at line 40 of file group_sync_write.h.

uint16_t dynamixel::GroupSyncWrite::start_address_
private

Definition at line 49 of file group_sync_write.h.


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


dynamixel_sdk
Author(s): Gilbert , Zerom , Darby Lim , Leon
autogenerated on Fri Apr 16 2021 02:25:55