Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00021
00022 #ifndef DYNAMIXEL_SDK_INCLUDE_DYNAMIXEL_SDK_GROUPSYNCREAD_H_
00023 #define DYNAMIXEL_SDK_INCLUDE_DYNAMIXEL_SDK_GROUPSYNCREAD_H_
00024
00025
00026 #include <map>
00027 #include <vector>
00028 #include "port_handler.h"
00029 #include "packet_handler.h"
00030
00031 namespace dynamixel
00032 {
00033
00037 class WINDECLSPEC GroupSyncRead
00038 {
00039 private:
00040 PortHandler *port_;
00041 PacketHandler *ph_;
00042
00043 std::vector<uint8_t> id_list_;
00044 std::map<uint8_t, uint8_t *> data_list_;
00045 std::map<uint8_t, uint8_t *> error_list_;
00046
00047 bool last_result_;
00048 bool is_param_changed_;
00049
00050 uint8_t *param_;
00051 uint16_t start_address_;
00052 uint16_t data_length_;
00053
00054 void makeParam();
00055
00056 public:
00064 GroupSyncRead(PortHandler *port, PacketHandler *ph, uint16_t start_address, uint16_t data_length);
00065
00069 ~GroupSyncRead() { clearParam(); }
00070
00075 PortHandler *getPortHandler() { return port_; }
00076
00081 PacketHandler *getPacketHandler() { return ph_; }
00082
00091 bool addParam (uint8_t id);
00092
00097 void removeParam (uint8_t id);
00098
00102 void clearParam ();
00103
00111 int txPacket();
00112
00122 int rxPacket();
00123
00134 int txRxPacket();
00135
00146 bool isAvailable (uint8_t id, uint16_t address, uint16_t data_length);
00147
00155 uint32_t getData (uint8_t id, uint16_t address, uint16_t data_length);
00156
00165 bool getError (uint8_t id, uint8_t* error);
00166 };
00167
00168 }
00169
00170
00171 #endif