EtherCat Telegram Base class. More...
#include <ethercat_telegram.h>
Public Member Functions | |
void | attach (EC_Telegram *a_telegram) |
attach telegram to this one - ordering is somewhat arbitrary | |
const unsigned char * | build (const unsigned char *a_buffer) |
Build and check telegram from data array. | |
unsigned char * | dump (unsigned char *a_buffer) const |
Dump the data struct into an array (EtherCAT Little Endian) | |
const unsigned char * | get_data (void) const |
Get pointer to data. | |
size_t | get_datalen (void) const |
Get data length. | |
uint8_t | get_idx (void) const |
Get index. | |
uint16_t | get_wkc (void) const |
Get working counter. | |
void | set_data (const unsigned char *a_data) |
Set data. | |
void | set_datalen (size_t len) |
Set data length. | |
void | set_idx (uint8_t a_idx) |
Set index. | |
void | set_wkc (uint16_t a_wkc) |
Set working counter. | |
Public Attributes | |
EC_Telegram * | next |
Pointer to next telegram. | |
EC_Telegram * | previous |
Pointer to previous telegram. | |
Protected Member Functions | |
virtual const unsigned char * | build_header_head (const unsigned char *a_buffer)=0 |
virtual bool | check_index (const unsigned char *buffer) const |
virtual bool | check_lennext (const unsigned char *buffer) const |
virtual unsigned char * | dump_header_head (unsigned char *a_buffer) const =0 |
Dump first 6 bytes of the header (varying across different telegrams) | |
EC_Telegram (size_t a_datasize=0, const unsigned char *a_data=NULL) | |
EC_Telegram (uint8_t a_idx, uint16_t a_wkc) | |
EC_Telegram (size_t a_datasize, const unsigned char *a_data, uint8_t a_idx, uint16_t a_wkc) | |
EC_Telegram (const EC_Telegram &a_telegram) | |
virtual size_t | header_length (void) const |
virtual size_t | tail_length (void) const |
Protected Attributes | |
const unsigned char * | m_data |
Pointer to data field. | |
uint8_t | m_idx |
Index Field. | |
uint16_t | m_wkc |
Working counter Field. | |
Static Protected Attributes | |
static const uint16_t | m_irq |
IRQ Field (currently unused) | |
Private Member Functions | |
virtual const unsigned char * | build_body (const unsigned char *a_buffer) |
EtherCat Telegram Base class.
This class should never be used explicitly, only use the interface. Therefore its constructor is protected. The names are chosen according to the Ethercat spec.
Definition at line 50 of file ethercat_telegram.h.
EC_Telegram::EC_Telegram | ( | size_t | a_datasize = 0 , |
const unsigned char * | a_data = NULL |
||
) | [protected] |
EC_Telegram::EC_Telegram | ( | uint8_t | a_idx, |
uint16_t | a_wkc | ||
) | [protected] |
EC_Telegram::EC_Telegram | ( | size_t | a_datasize, |
const unsigned char * | a_data, | ||
uint8_t | a_idx, | ||
uint16_t | a_wkc | ||
) | [protected] |
EC_Telegram::EC_Telegram | ( | const EC_Telegram & | a_telegram | ) | [protected] |
void EC_Telegram::attach | ( | EC_Telegram * | a_telegram | ) |
attach telegram to this one - ordering is somewhat arbitrary
const unsigned char* EC_Telegram::build | ( | const unsigned char * | a_buffer | ) |
Build and check telegram from data array.
virtual const unsigned char* EC_Telegram::build_body | ( | const unsigned char * | a_buffer | ) | [private, virtual] |
virtual const unsigned char* EC_Telegram::build_header_head | ( | const unsigned char * | a_buffer | ) | [protected, pure virtual] |
Build and check first 6 bytes of the header (varying across different telegrams)
a_buffer | Adress to start writing |
Implemented in Device_Addressing_Telegram, and Logical_Addressing_Telegram.
virtual bool EC_Telegram::check_index | ( | const unsigned char * | buffer | ) | const [protected, virtual] |
virtual bool EC_Telegram::check_lennext | ( | const unsigned char * | buffer | ) | const [protected, virtual] |
unsigned char* EC_Telegram::dump | ( | unsigned char * | a_buffer | ) | const [virtual] |
Dump the data struct into an array (EtherCAT Little Endian)
a_buffer | where data should be dumped |
Implements EC_DataStruct.
virtual unsigned char* EC_Telegram::dump_header_head | ( | unsigned char * | a_buffer | ) | const [protected, pure virtual] |
Dump first 6 bytes of the header (varying across different telegrams)
a_buffer | Adress to start writing |
Implemented in Device_Addressing_Telegram, and Logical_Addressing_Telegram.
const unsigned char* EC_Telegram::get_data | ( | void | ) | const [inline] |
Get pointer to data.
Definition at line 79 of file ethercat_telegram.h.
size_t EC_Telegram::get_datalen | ( | void | ) | const [inline] |
Get data length.
Definition at line 89 of file ethercat_telegram.h.
uint8_t EC_Telegram::get_idx | ( | void | ) | const [inline] |
Get index.
Definition at line 74 of file ethercat_telegram.h.
uint16_t EC_Telegram::get_wkc | ( | void | ) | const [inline] |
Get working counter.
Definition at line 69 of file ethercat_telegram.h.
virtual size_t EC_Telegram::header_length | ( | void | ) | const [inline, protected, virtual] |
Definition at line 146 of file ethercat_telegram.h.
void EC_Telegram::set_data | ( | const unsigned char * | a_data | ) | [inline] |
Set data.
Definition at line 84 of file ethercat_telegram.h.
void EC_Telegram::set_datalen | ( | size_t | len | ) | [inline] |
Set data length.
Definition at line 96 of file ethercat_telegram.h.
void EC_Telegram::set_idx | ( | uint8_t | a_idx | ) | [inline] |
Set index.
Definition at line 64 of file ethercat_telegram.h.
void EC_Telegram::set_wkc | ( | uint16_t | a_wkc | ) | [inline] |
Set working counter.
Definition at line 59 of file ethercat_telegram.h.
virtual size_t EC_Telegram::tail_length | ( | void | ) | const [inline, protected, virtual] |
Definition at line 150 of file ethercat_telegram.h.
const unsigned char* EC_Telegram::m_data [protected] |
Pointer to data field.
Definition at line 137 of file ethercat_telegram.h.
uint8_t EC_Telegram::m_idx [protected] |
Index Field.
Definition at line 141 of file ethercat_telegram.h.
const uint16_t EC_Telegram::m_irq [static, protected] |
IRQ Field (currently unused)
Definition at line 145 of file ethercat_telegram.h.
uint16_t EC_Telegram::m_wkc [protected] |
Working counter Field.
Definition at line 143 of file ethercat_telegram.h.
Pointer to next telegram.
Definition at line 107 of file ethercat_telegram.h.
Pointer to previous telegram.
Definition at line 109 of file ethercat_telegram.h.