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

The class for writing multiple Dynamixel data from different addresses with different lengths at once. More...

#include <group_bulk_write.h>

Public Member Functions

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

Private Member Functions

void makeParam ()
 

Private Attributes

std::map< uint8_t, uint16_t > address_list_
 
std::map< uint8_t, uint8_t * > data_list_
 
std::vector< uint8_t > id_list_
 
bool is_param_changed_
 
std::map< uint8_t, uint16_t > length_list_
 
uint8_t * param_
 
uint16_t param_length_
 
PacketHandlerph_
 
PortHandlerport_
 

Detailed Description

The class for writing multiple Dynamixel data from different addresses with different lengths at once.

Definition at line 37 of file group_bulk_write.h.

Constructor & Destructor Documentation

GroupBulkWrite::GroupBulkWrite ( PortHandler port,
PacketHandler ph 
)

The function that Initializes instance for Bulk Write.

Parameters
portPortHandler instance
phPacketHandler instance

Definition at line 34 of file group_bulk_write.cpp.

dynamixel::GroupBulkWrite::~GroupBulkWrite ( )
inline

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

Definition at line 66 of file group_bulk_write.h.

Member Function Documentation

bool GroupBulkWrite::addParam ( uint8_t  id,
uint16_t  start_address,
uint16_t  data_length,
uint8_t *  data 
)

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

Parameters
idDynamixel ID
start_addressAddress of the data for write
data_lengthLength of the data for write
Returns
false
when the ID exists already in the list
or true

Definition at line 76 of file group_bulk_write.cpp.

bool GroupBulkWrite::changeParam ( uint8_t  id,
uint16_t  start_address,
uint16_t  data_length,
uint8_t *  data 
)

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

Parameters
idDynamixel ID
start_addressAddress of the data for write
data_lengthLength of the data for write
datafor replacement
Returns
false
when the ID doesn't exist in the list
or true

Definition at line 111 of file group_bulk_write.cpp.

void GroupBulkWrite::clearParam ( )

The function that clears the Bulk Write list.

Definition at line 130 of file group_bulk_write.cpp.

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

The function that returns PacketHandler instance.

Returns
PacketHandler instance

Definition at line 78 of file group_bulk_write.h.

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

The function that returns PortHandler instance.

Returns
PortHandler instance

Definition at line 72 of file group_bulk_write.h.

void GroupBulkWrite::makeParam ( )
private

Definition at line 44 of file group_bulk_write.cpp.

void GroupBulkWrite::removeParam ( uint8_t  id)

The function that removes id from the Bulk Write list.

Parameters
idDynamixel ID

Definition at line 94 of file group_bulk_write.cpp.

int GroupBulkWrite::txPacket ( )

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

Returns
COMM_NOT_AVAILABLE
when the list for Bulk Write is empty
when Protocol1.0 has been used
or the other communication results which come from PacketHandler::bulkWriteTxOnly

Definition at line 146 of file group_bulk_write.cpp.

Member Data Documentation

std::map<uint8_t, uint16_t> dynamixel::GroupBulkWrite::address_list_
private

Definition at line 44 of file group_bulk_write.h.

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

Definition at line 46 of file group_bulk_write.h.

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

Definition at line 43 of file group_bulk_write.h.

bool dynamixel::GroupBulkWrite::is_param_changed_
private

Definition at line 48 of file group_bulk_write.h.

std::map<uint8_t, uint16_t> dynamixel::GroupBulkWrite::length_list_
private

Definition at line 45 of file group_bulk_write.h.

uint8_t* dynamixel::GroupBulkWrite::param_
private

Definition at line 50 of file group_bulk_write.h.

uint16_t dynamixel::GroupBulkWrite::param_length_
private

Definition at line 51 of file group_bulk_write.h.

PacketHandler* dynamixel::GroupBulkWrite::ph_
private

Definition at line 41 of file group_bulk_write.h.

PortHandler* dynamixel::GroupBulkWrite::port_
private

Definition at line 40 of file group_bulk_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