group_bulk_read.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 * Copyright 2017 ROBOTIS CO., LTD.
00003 *
00004 * Licensed under the Apache License, Version 2.0 (the "License");
00005 * you may not use this file except in compliance with the License.
00006 * You may obtain a copy of the License at
00007 *
00008 *     http://www.apache.org/licenses/LICENSE-2.0
00009 *
00010 * Unless required by applicable law or agreed to in writing, software
00011 * distributed under the License is distributed on an "AS IS" BASIS,
00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013 * See the License for the specific language governing permissions and
00014 * limitations under the License.
00015 *******************************************************************************/
00016 
00021 
00022 #ifndef DYNAMIXEL_SDK_INCLUDE_DYNAMIXEL_SDK_GROUPBULKREAD_H_
00023 #define DYNAMIXEL_SDK_INCLUDE_DYNAMIXEL_SDK_GROUPBULKREAD_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 GroupBulkRead
00038 {
00039  private:
00040   PortHandler    *port_;
00041   PacketHandler  *ph_;
00042 
00043   std::vector<uint8_t>            id_list_;
00044   std::map<uint8_t, uint16_t>     address_list_;  // <id, start_address>
00045   std::map<uint8_t, uint16_t>     length_list_;   // <id, data_length>
00046   std::map<uint8_t, uint8_t *>    data_list_;     // <id, data>
00047   std::map<uint8_t, uint8_t *>    error_list_;    // <id, error>
00048 
00049   bool            last_result_;
00050   bool            is_param_changed_;
00051 
00052   uint8_t        *param_;
00053 
00054   void    makeParam();
00055 
00056  public:
00062   GroupBulkRead(PortHandler *port, PacketHandler *ph);
00063 
00067   ~GroupBulkRead() { clearParam(); }
00068 
00073   PortHandler     *getPortHandler()   { return port_; }
00074 
00079   PacketHandler   *getPacketHandler() { return ph_; }
00080 
00090   bool    addParam    (uint8_t id, uint16_t start_address, uint16_t data_length);
00091 
00096   void    removeParam (uint8_t id);
00097 
00101   void    clearParam  ();
00102 
00109   int     txPacket();
00110 
00121   int     rxPacket();
00122 
00131   int     txRxPacket();
00132 
00142   bool        isAvailable (uint8_t id, uint16_t address, uint16_t data_length);
00143 
00151   uint32_t    getData     (uint8_t id, uint16_t address, uint16_t data_length);
00152 
00161   bool        getError    (uint8_t id, uint8_t* error);
00162 };
00163 
00164 }
00165 
00166 
00167 #endif /* DYNAMIXEL_SDK_INCLUDE_DYNAMIXEL_SDK_GROUPBULKREAD_H_ */


ros
Author(s): Pyo , Zerom , Leon
autogenerated on Sat Jun 8 2019 18:32:11