z1_controller/include/interface/IOUDP.h

26 lines
537 B
C
Raw Normal View History

2022-07-20 11:11:38 +08:00
#ifndef IOUDP_H
#define IOUDP_H
#include "interface/IOInterface.h"
class IOUDP : public IOInterface{
public:
2022-11-11 19:49:41 +08:00
IOUDP(const char* IP, uint port);
2022-07-20 11:11:38 +08:00
~IOUDP();
2022-11-11 19:49:41 +08:00
bool sendRecv(const LowlevelCmd *cmd, LowlevelState *state);
2022-07-20 11:11:38 +08:00
bool calibration();
2022-11-11 19:49:41 +08:00
bool isDisconnect(){ return _ioPort->isDisConnect;}
2022-07-20 11:11:38 +08:00
private:
IOPort *_ioPort;
UDPSendCmd _cmd;
UDPRecvState _state;
2022-11-11 19:49:41 +08:00
UDPRecvStateOld _stateOld;
2022-07-20 11:11:38 +08:00
size_t _motorNum;
size_t _jointNum;
2022-09-13 19:53:15 +08:00
uint8_t _singleState;
uint8_t _selfCheck[10];
2022-07-20 11:11:38 +08:00
};
#endif // IOUDP_H