31 #define NUMBER_OF_RETRIES_SEND 3 // Number of retries after a failing in the Communication 32 #define NUMBER_OF_RETRIES_RECV 3 // Number of retries after a failing in the Communication 102 virtual bool load_tbl() = 0;
103 virtual void defineProtocol(
byte _kataddr) = 0;
142 virtual void send(
byte* send_buf,
byte write_sz,
short retries = 3);
143 virtual void recv(
byte* read_buf,
byte read_sz,
byte* size);
167 #endif //_CPLSERIALZERO_H_ unsigned char byte
type specification (8 bit)
byte send_sz
send size of the packet
Abstract base class for protocol definiton.
Implement the Serial-Zero protocol.
Exception(const std::string &message, const int error_number)
Exception reported by the firmware
CRC check for the answer package failed
FirmwareException(const std::string &error, const int error_number, const int axis, const char command)
char _command_char
the command that caused the error
const int KATANA_ERROR_FLAG
defines the error flag number
virtual void comm(const byte *pack, byte *buf, byte *size)=0
Base communication function.
virtual void defineProtocol(byte _kataddr)=0
Defines the protocol's attributes.
int _axis_number
axis number, if any
byte read_sz
read size of the packet
const int error_number() const
const int axis_number() const
const char command_char() const
Base class of two different serial protocols.
virtual bool init(CCdlBase *_device, byte _kataddr=24)=0
Basic initializing function.
Abstract base class for devices.
virtual void getMasterFirmware(short *fw, short *rev)=0
Get the master firmware of the robot we are communicating with.
virtual bool load_tbl()=0
Loads the command table from the robot's firmware.