00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __ethercat_device_addressed_telegram_h__
00034 #define __ethercat_device_addressed_telegram_h__
00035
00036 #include "ros_ethercat_eml/ethercat_telegram.h"
00037
00039
00046 class Device_Addressing_Telegram : public EC_Telegram
00047 {
00048 public:
00050
00057 Device_Addressing_Telegram(uint8_t a_idx = 0x00,
00058 uint16_t a_adp = 0x0000,
00059 uint16_t a_ado = 0x0000,
00060 uint16_t a_wkc = 0x0000,
00061 uint16_t a_datalen = 0x0000,
00062 const unsigned char * a_data = NULL);
00063 virtual ~Device_Addressing_Telegram()
00064 {
00065 }
00066
00068 void set_adp(uint16_t a_adp)
00069 {
00070 m_adp = a_adp;
00071 }
00073 void set_ado(uint16_t a_ado)
00074 {
00075 m_ado = a_ado;
00076 }
00078 uint16_t get_adp() const
00079 {
00080 return m_adp;
00081 }
00083 uint16_t get_ado() const
00084 {
00085 return m_ado;
00086 }
00087
00088 protected:
00089 virtual unsigned char * dump_header_head(unsigned char * a_buffer) const;
00090 virtual unsigned char * dump_command_field(unsigned char * a_buffer) const = 0;
00091
00092 virtual const unsigned char * build_header_head(const unsigned char * a_buffer);
00093 virtual const unsigned char * build_command_field(const unsigned char * a_buffer) = 0;
00094
00095 private:
00096 uint16_t m_adp;
00097 uint16_t m_ado;
00098 };
00099
00101
00102 class APRD_Telegram : public Device_Addressing_Telegram
00103 {
00104 public:
00106
00115 APRD_Telegram(uint8_t a_idx, uint16_t a_adp,
00116 uint16_t a_ado,
00117 uint16_t a_wkc,
00118 uint16_t a_datalen,
00119 const unsigned char * a_data);
00120
00122
00123
00124 protected:
00125 virtual unsigned char * dump_command_field(unsigned char * a_buffer) const;
00126 virtual const unsigned char * build_command_field(const unsigned char * a_buffer);
00127 };
00128
00130
00131 class APWR_Telegram : public Device_Addressing_Telegram
00132 {
00133 public:
00135
00142 APWR_Telegram(uint8_t a_idx, uint16_t a_adp,
00143 uint16_t a_ado,
00144 uint16_t a_wkc,
00145 uint16_t a_datalen,
00146 const unsigned char * a_data);
00147
00148 protected:
00149 virtual unsigned char * dump_command_field(unsigned char * a_buffer) const;
00150 virtual const unsigned char * build_command_field(const unsigned char * a_buffer);
00151 };
00152
00154
00155 class APRW_Telegram : public Device_Addressing_Telegram
00156 {
00157 public:
00159
00166 APRW_Telegram(uint8_t a_idx, uint16_t a_adp,
00167 uint16_t a_ado,
00168 uint16_t a_wkc,
00169 uint16_t a_datalen,
00170 const unsigned char * a_data);
00171
00172 protected:
00173 virtual unsigned char * dump_command_field(unsigned char * a_buffer) const;
00174 virtual const unsigned char * build_command_field(const unsigned char * a_buffer);
00175 };
00176
00178
00179 class BWR_Telegram : public Device_Addressing_Telegram
00180 {
00181 public:
00183
00189 BWR_Telegram(uint8_t a_idx, uint16_t a_ado,
00190 uint16_t a_wkc,
00191 uint16_t a_datalen,
00192 const unsigned char * a_data);
00193
00194 protected:
00195 virtual unsigned char * dump_command_field(unsigned char * a_buffer) const;
00196 virtual const unsigned char * build_command_field(const unsigned char * a_buffer);
00197 };
00198
00200
00201 class BRD_Telegram : public Device_Addressing_Telegram
00202 {
00203 public:
00205
00211 BRD_Telegram(uint8_t a_idx, uint16_t a_ado,
00212 uint16_t a_wkc,
00213 uint16_t a_datalen,
00214 const unsigned char * a_data);
00215
00216 protected:
00217 virtual unsigned char * dump_command_field(unsigned char * a_buffer) const;
00218 virtual const unsigned char * build_command_field(const unsigned char * a_buffer);
00219 };
00220
00222
00226 class NPWR_Telegram : public Device_Addressing_Telegram
00227 {
00228 public:
00230
00237 NPWR_Telegram(uint8_t a_idx, uint16_t a_adp,
00238 uint16_t a_ado,
00239 uint16_t a_wkc,
00240 uint16_t a_datalen,
00241 const unsigned char * a_data);
00242
00243 protected:
00244 virtual unsigned char * dump_command_field(unsigned char * a_buffer) const;
00245 virtual const unsigned char * build_command_field(const unsigned char * a_buffer);
00246 };
00247
00249
00253 class NPRW_Telegram : public Device_Addressing_Telegram
00254 {
00255 public:
00257
00264 NPRW_Telegram(uint8_t a_idx, uint16_t a_adp,
00265 uint16_t a_ado,
00266 uint16_t a_wkc,
00267 uint16_t a_datalen,
00268 const unsigned char * a_data);
00269
00270 protected:
00271 virtual unsigned char * dump_command_field(unsigned char * a_buffer) const;
00272 virtual const unsigned char * build_command_field(const unsigned char * a_buffer);
00273 };
00274
00276
00280 class NPRD_Telegram : public Device_Addressing_Telegram
00281 {
00282 public:
00284
00291 NPRD_Telegram(uint8_t a_idx, uint16_t a_adp,
00292 uint16_t a_ado,
00293 uint16_t a_wkc,
00294 uint16_t a_datalen,
00295 const unsigned char * a_data);
00296
00297 protected:
00298 virtual unsigned char * dump_command_field(unsigned char * a_buffer) const;
00299 virtual const unsigned char * build_command_field(const unsigned char * a_buffer);
00300 };
00301
00303
00304 class ARMW_Telegram : public Device_Addressing_Telegram
00305 {
00306 public:
00308
00315 ARMW_Telegram(uint8_t a_idx, uint16_t a_adp,
00316 uint16_t a_ado,
00317 uint16_t a_wkc,
00318 uint16_t a_datalen,
00319 const unsigned char * a_data);
00320
00321 protected:
00322 virtual unsigned char * dump_command_field(unsigned char * a_buffer) const;
00323 virtual const unsigned char * build_command_field(const unsigned char * a_buffer);
00324 };
00325
00326 #endif // __ethercat_device_addressed_telegram_h__