ethercateoe.c
Go to the documentation of this file.
1 /*
2  * Licensed under the GNU General Public License version 2 with exceptions. See
3  * LICENSE file in the project root for full license information
4  */
5 
15 #include <stdio.h>
16 #include <string.h>
17 #include "osal.h"
18 #include "oshw.h"
19 #include "ethercat.h"
20 
25 static void EOE_ip_uint32_to_byte(eoe_ip4_addr_t * ip, uint8_t * byte_ip)
26 {
27  byte_ip[3] = eoe_ip4_addr1(ip); /* 1st octet */
28  byte_ip[2] = eoe_ip4_addr2(ip); /* 2nd octet */
29  byte_ip[1] = eoe_ip4_addr3(ip); /* 3ed octet */
30  byte_ip[0] = eoe_ip4_addr4(ip); /* 4th octet */
31 }
32 
37 static void EOE_ip_byte_to_uint32(uint8_t * byte_ip, eoe_ip4_addr_t * ip)
38 {
40  byte_ip[3], /* 1st octet */
41  byte_ip[2], /* 2nd octet */
42  byte_ip[1], /* 3ed octet */
43  byte_ip[0]); /* 4th octet */
44 }
45 
52 int ecx_EOEdefinehook(ecx_contextt *context, void *hook)
53 {
54  context->EOEhook = hook;
55  return 1;
56 }
57 
67 int ecx_EOEsetIp(ecx_contextt *context, uint16 slave, uint8 port, eoe_param_t * ipparam, int timeout)
68 {
69  ec_EOEt *EOEp, *aEOEp;
70  ec_mbxbuft MbxIn, MbxOut;
71  uint16 frameinfo1, result;
72  uint8 cnt, data_offset;
73  uint8 flags = 0;
74  int wkc;
75 
76  ec_clearmbx(&MbxIn);
77  /* Empty slave out mailbox if something is in. Timout set to 0 */
78  wkc = ecx_mbxreceive(context, slave, (ec_mbxbuft *)&MbxIn, 0);
79  ec_clearmbx(&MbxOut);
80  aEOEp = (ec_EOEt *)&MbxIn;
81  EOEp = (ec_EOEt *)&MbxOut;
82  EOEp->mbxheader.address = htoes(0x0000);
83  EOEp->mbxheader.priority = 0x00;
84  data_offset = EOE_PARAM_OFFSET;
85 
86  /* get new mailbox count value, used as session handle */
87  cnt = ec_nextmbxcnt(context->slavelist[slave].mbx_cnt);
88  context->slavelist[slave].mbx_cnt = cnt;
89 
90  EOEp->mbxheader.mbxtype = ECT_MBXT_EOE + (cnt << 4); /* EoE */
91 
92  EOEp->frameinfo1 = htoes(EOE_HDR_FRAME_TYPE_SET(EOE_INIT_REQ) |
95  EOEp->frameinfo2 = 0;
96 
97  /* The EoE frame will include "empty" IP/DNS entries, makes wireshark happy.
98  * Specification say they are optional, TwinCAT include empty entries.
99  */
100  if (ipparam->mac_set)
101  {
102  flags |= EOE_PARAM_MAC_INCLUDE;
103  memcpy(&EOEp->data[data_offset], ipparam->mac.addr, EOE_ETHADDR_LENGTH);
104  }
105  data_offset += EOE_ETHADDR_LENGTH;
106  if (ipparam->ip_set)
107  {
108  flags |= EOE_PARAM_IP_INCLUDE;
109  EOE_ip_uint32_to_byte(&ipparam->ip, &EOEp->data[data_offset]);
110  }
111  data_offset += 4;
112  if (ipparam->subnet_set)
113  {
115  EOE_ip_uint32_to_byte(&ipparam->subnet, &EOEp->data[data_offset]);
116  }
117  data_offset += 4;
118  if (ipparam->default_gateway_set)
119  {
121  EOE_ip_uint32_to_byte(&ipparam->default_gateway, &EOEp->data[data_offset]);
122  }
123  data_offset += 4;
124  if (ipparam->dns_ip_set)
125  {
126  flags |= EOE_PARAM_DNS_IP_INCLUDE;
127  EOE_ip_uint32_to_byte(&ipparam->dns_ip, &EOEp->data[data_offset]);
128  }
129  data_offset += 4;
130  if (ipparam->dns_name_set)
131  {
133  memcpy(&EOEp->data[data_offset], (void *)ipparam->dns_name, EOE_DNS_NAME_LENGTH);
134  }
135  data_offset += EOE_DNS_NAME_LENGTH;
136 
137  EOEp->mbxheader.length = htoes(EOE_PARAM_OFFSET + data_offset);
138  EOEp->data[0] = flags;
139 
140  /* send EoE request to slave */
141  wkc = ecx_mbxsend(context, slave, (ec_mbxbuft *)&MbxOut, EC_TIMEOUTTXM);
142 
143  if (wkc > 0) /* succeeded to place mailbox in slave ? */
144  {
145  /* clean mailboxbuffer */
146  ec_clearmbx(&MbxIn);
147  /* read slave response */
148  wkc = ecx_mbxreceive(context, slave, (ec_mbxbuft *)&MbxIn, timeout);
149  if (wkc > 0) /* succeeded to read slave response ? */
150  {
151  /* slave response should be FoE */
152  if ((aEOEp->mbxheader.mbxtype & 0x0f) == ECT_MBXT_EOE)
153  {
154  frameinfo1 = etohs(aEOEp->frameinfo1);
155  result = etohs(aEOEp->result);
156  if ((EOE_HDR_FRAME_TYPE_GET(frameinfo1) != EOE_INIT_RESP) ||
157  (result != EOE_RESULT_SUCCESS))
158  {
159  wkc = -result;
160  }
161  }
162  else
163  {
164  /* unexpected mailbox received */
166  }
167  }
168  }
169  return wkc;
170 }
171 
181 int ecx_EOEgetIp(ecx_contextt *context, uint16 slave, uint8 port, eoe_param_t * ipparam, int timeout)
182 {
183  ec_EOEt *EOEp, *aEOEp;
184  ec_mbxbuft MbxIn, MbxOut;
185  uint16 frameinfo1, eoedatasize;
186  uint8 cnt, data_offset;
187  uint8 flags = 0;
188  int wkc;
189 
190  /* Empty slave out mailbox if something is in. Timout set to 0 */
191  wkc = ecx_mbxreceive(context, slave, (ec_mbxbuft *)&MbxIn, 0);
192  ec_clearmbx(&MbxOut);
193  aEOEp = (ec_EOEt *)&MbxIn;
194  EOEp = (ec_EOEt *)&MbxOut;
195  EOEp->mbxheader.address = htoes(0x0000);
196  EOEp->mbxheader.priority = 0x00;
197  data_offset = EOE_PARAM_OFFSET;
198 
199  /* get new mailbox count value, used as session handle */
200  cnt = ec_nextmbxcnt(context->slavelist[slave].mbx_cnt);
201  context->slavelist[slave].mbx_cnt = cnt;
202 
203  EOEp->mbxheader.mbxtype = ECT_MBXT_EOE + (cnt << 4); /* EoE */
204 
205  EOEp->frameinfo1 = htoes(EOE_HDR_FRAME_TYPE_SET(EOE_GET_IP_PARAM_REQ) |
206  EOE_HDR_FRAME_PORT_SET(port) |
208  EOEp->frameinfo2 = 0;
209 
210  EOEp->mbxheader.length = htoes(0x0004);
211  EOEp->data[0] = flags;
212 
213  /* send EoE request to slave */
214  wkc = ecx_mbxsend(context, slave, (ec_mbxbuft *)&MbxOut, EC_TIMEOUTTXM);
215  if (wkc > 0) /* succeeded to place mailbox in slave ? */
216  {
217  /* clean mailboxbuffer */
218  ec_clearmbx(&MbxIn);
219  /* read slave response */
220  wkc = ecx_mbxreceive(context, slave, (ec_mbxbuft *)&MbxIn, timeout);
221  if (wkc > 0) /* succeeded to read slave response ? */
222  {
223  /* slave response should be FoE */
224  if ((aEOEp->mbxheader.mbxtype & 0x0f) == ECT_MBXT_EOE)
225  {
226  frameinfo1 = etohs(aEOEp->frameinfo1);
227  eoedatasize = etohs(aEOEp->mbxheader.length) - 0x0004;
229  {
231  }
232  else
233  {
234  /* The EoE frame will include "empty" IP/DNS entries, makes
235  * wireshark happy. Specification say they are optional, TwinCAT
236  * include empty entries.
237  */
238  flags = aEOEp->data[0];
239  if (flags & EOE_PARAM_MAC_INCLUDE)
240  {
241  memcpy(ipparam->mac.addr,
242  &aEOEp->data[data_offset],
244  ipparam->mac_set = 1;
245  }
246  data_offset += EOE_ETHADDR_LENGTH;
247  if (flags & EOE_PARAM_IP_INCLUDE)
248  {
249  EOE_ip_byte_to_uint32(&aEOEp->data[data_offset],
250  &ipparam->ip);
251  ipparam->ip_set = 1;
252  }
253  data_offset += 4;
254  if (flags & EOE_PARAM_SUBNET_IP_INCLUDE)
255  {
256  EOE_ip_byte_to_uint32(&aEOEp->data[data_offset],
257  &ipparam->subnet);
258  ipparam->subnet_set = 1;
259  }
260  data_offset += 4;
262  {
263  EOE_ip_byte_to_uint32(&aEOEp->data[data_offset],
264  &ipparam->default_gateway);
265  ipparam->default_gateway_set = 1;
266  }
267  data_offset += 4;
268  if (flags & EOE_PARAM_DNS_IP_INCLUDE)
269  {
270  EOE_ip_byte_to_uint32(&aEOEp->data[data_offset],
271  &ipparam->dns_ip);
272  ipparam->dns_ip_set = 1;
273  }
274  data_offset += 4;
275  if (flags & EOE_PARAM_DNS_NAME_INCLUDE)
276  {
277  uint16_t dns_len;
278  if ((eoedatasize - data_offset) < EOE_DNS_NAME_LENGTH)
279  {
280  dns_len = (eoedatasize - data_offset);
281  }
282  else
283  {
284  dns_len = EOE_DNS_NAME_LENGTH;
285  }
286  /* Assume ZERO terminated string */
287  memcpy(ipparam->dns_name, &aEOEp->data[data_offset], dns_len);
288  ipparam->dns_name_set = 1;
289  }
290  data_offset += EOE_DNS_NAME_LENGTH;
291  /* Something os not correct, flag the error */
292  if(data_offset > eoedatasize)
293  {
294  wkc = -EC_ERR_TYPE_MBX_ERROR;
295  }
296  }
297  }
298  else
299  {
300  /* unexpected mailbox received */
302  }
303  }
304  }
305  return wkc;
306 }
307 
322 int ecx_EOEsend(ecx_contextt *context, uint16 slave, uint8 port, int psize, void *p, int timeout)
323 {
324  ec_EOEt *EOEp;
325  ec_mbxbuft MbxOut;
326  uint16 frameinfo1, frameinfo2;
327  uint16 txframesize, txframeoffset;
328  uint8 cnt, txfragmentno;
329  boolean NotLast;
330  int wkc, maxdata;
331  const uint8 * buf = p;
332  static uint8_t txframeno = 0;
333 
334  ec_clearmbx(&MbxOut);
335  EOEp = (ec_EOEt *)&MbxOut;
336  EOEp->mbxheader.address = htoes(0x0000);
337  EOEp->mbxheader.priority = 0x00;
338  /* data section=mailbox size - 6 mbx - 4 EoEh */
339  maxdata = context->slavelist[slave].mbx_l - 0x0A;
340  txframesize = psize;
341  txfragmentno = 0;
342  txframeoffset = 0;
343  NotLast = TRUE;
344 
345  do
346  {
347  txframesize = psize - txframeoffset;
348  if (txframesize > maxdata)
349  {
350  /* Adjust to even 32-octect blocks */
351  txframesize = ((maxdata >> 5) << 5);
352  }
353 
354  if (txframesize == (psize - txframeoffset))
355  {
356  frameinfo1 = (EOE_HDR_LAST_FRAGMENT_SET(1) | EOE_HDR_FRAME_PORT_SET(port));
357  NotLast = FALSE;
358  }
359  else
360  {
361  frameinfo1 = EOE_HDR_FRAME_PORT_SET(port);
362  }
363 
364  frameinfo2 = EOE_HDR_FRAG_NO_SET(txfragmentno);
365  if (txfragmentno > 0)
366  {
367  frameinfo2 = frameinfo2 | (EOE_HDR_FRAME_OFFSET_SET((txframeoffset >> 5)));
368  }
369  else
370  {
371  frameinfo2 = frameinfo2 | (EOE_HDR_FRAME_OFFSET_SET(((psize + 31) >> 5)));
372  txframeno++;
373  }
374  frameinfo2 = frameinfo2 | EOE_HDR_FRAME_NO_SET(txframeno);
375 
376  /* get new mailbox count value, used as session handle */
377  cnt = ec_nextmbxcnt(context->slavelist[slave].mbx_cnt);
378  context->slavelist[slave].mbx_cnt = cnt;
379 
380  EOEp->mbxheader.length = htoes(4 + txframesize); /* no timestamp */
381  EOEp->mbxheader.mbxtype = ECT_MBXT_EOE + (cnt << 4); /* EoE */
382 
383  EOEp->frameinfo1 = htoes(frameinfo1);
384  EOEp->frameinfo2 = htoes(frameinfo2);
385 
386  memcpy(EOEp->data, &buf[txframeoffset], txframesize);
387 
388  /* send EoE request to slave */
389  wkc = ecx_mbxsend(context, slave, (ec_mbxbuft *)&MbxOut, timeout);
390  if ((NotLast == TRUE) && (wkc > 0))
391  {
392  txframeoffset += txframesize;
393  txfragmentno++;
394  }
395  } while ((NotLast == TRUE) && (wkc > 0));
396 
397  return wkc;
398 }
399 
400 
415 int ecx_EOErecv(ecx_contextt *context, uint16 slave, uint8 port, int * psize, void *p, int timeout)
416 {
417  ec_EOEt *aEOEp;
418  ec_mbxbuft MbxIn;
419  uint16 frameinfo1, frameinfo2, rxframesize, rxframeoffset, eoedatasize;
421  boolean NotLast;
422  int wkc, buffersize;
423  uint8 * buf = p;
424 
425  ec_clearmbx(&MbxIn);
426  aEOEp = (ec_EOEt *)&MbxIn;
427  NotLast = TRUE;
428  buffersize = *psize;
429  rxfragmentno = 0;
430 
431  /* Hang for a while if nothing is in */
432  wkc = ecx_mbxreceive(context, slave, (ec_mbxbuft *)&MbxIn, timeout);
433 
434  while ((wkc > 0) && (NotLast == TRUE))
435  {
436  /* slave response should be FoE */
437  if ((aEOEp->mbxheader.mbxtype & 0x0f) == ECT_MBXT_EOE)
438  {
439 
440  eoedatasize = etohs(aEOEp->mbxheader.length) - 0x00004;
441  frameinfo1 = etohs(aEOEp->frameinfo1);
442  frameinfo2 = etohs(aEOEp->frameinfo2);
443 
444  if (rxfragmentno != EOE_HDR_FRAG_NO_GET(frameinfo2))
445  {
446  if (EOE_HDR_FRAG_NO_GET(frameinfo2) > 0)
447  {
449  /* Exit here*/
450  break;
451  }
452  }
453 
454  if (rxfragmentno == 0)
455  {
456  rxframeoffset = 0;
457  rxframeno = EOE_HDR_FRAME_NO_GET(frameinfo2);
458  rxframesize = (EOE_HDR_FRAME_OFFSET_GET(frameinfo2) << 5);
459  if (rxframesize > buffersize)
460  {
462  /* Exit here*/
463  break;
464  }
465  if (port != EOE_HDR_FRAME_PORT_GET(frameinfo1))
466  {
468  /* Exit here*/
469  break;
470  }
471  }
472  else
473  {
474  if (rxframeno != EOE_HDR_FRAME_NO_GET(frameinfo2))
475  {
477  /* Exit here*/
478  break;
479  }
480  else if (rxframeoffset != (EOE_HDR_FRAME_OFFSET_GET(frameinfo2) << 5))
481  {
483  /* Exit here*/
484  break;
485  }
486  }
487 
488  if ((rxframeoffset + eoedatasize) <= buffersize)
489  {
490  memcpy(&buf[rxframeoffset], aEOEp->data, eoedatasize);
491  rxframeoffset += eoedatasize;
492  rxfragmentno++;
493  }
494 
495  if (EOE_HDR_LAST_FRAGMENT_GET(frameinfo1))
496  {
497  /* Remove timestamp */
498  if (EOE_HDR_TIME_APPEND_GET(frameinfo1))
499  {
500  rxframeoffset -= 4;
501  }
502  NotLast = FALSE;
503  *psize = rxframeoffset;
504  }
505  else
506  {
507  /* Hang for a while if nothing is in */
508  wkc = ecx_mbxreceive(context, slave, (ec_mbxbuft *)&MbxIn, timeout);
509  }
510  }
511  else
512  {
513  /* unexpected mailbox received */
515  }
516  }
517  return wkc;
518 }
519 
535  ec_mbxbuft * MbxIn,
537  uint16 * rxframesize,
539  uint16 * rxframeno,
540  int * psize,
541  void *p)
542 {
543  uint16 frameinfo1, frameinfo2, eoedatasize;
544  int wkc;
545  ec_EOEt * aEOEp;
546  uint8 * buf;
547 
548  aEOEp = (ec_EOEt *)MbxIn;
549  buf = p;
550  wkc = 0;
551 
552  /* slave response should be EoE */
553  if ((aEOEp->mbxheader.mbxtype & 0x0f) == ECT_MBXT_EOE)
554  {
555  eoedatasize = etohs(aEOEp->mbxheader.length) - 0x00004;
556  frameinfo1 = etohs(aEOEp->frameinfo1);
557  frameinfo2 = etohs(aEOEp->frameinfo2);
558 
559  /* Retrive fragment number, is it what we expect? */
560  if (*rxfragmentno != EOE_HDR_FRAG_NO_GET(frameinfo2))
561  {
562  /* If expected fragment number is not 0, reset working variables */
563  if (*rxfragmentno != 0)
564  {
565  *rxfragmentno = 0;
566  *rxframesize = 0;
567  *rxframeoffset = 0;
568  *rxframeno = 0;
569  }
570 
571  /* If incoming fragment number is not 0 we can't recover, exit */
572  if (EOE_HDR_FRAG_NO_GET(frameinfo2) > 0)
573  {
575  return wkc;
576  }
577  }
578 
579  /* Is it a new frame?*/
580  if (*rxfragmentno == 0)
581  {
582  *rxframesize = (EOE_HDR_FRAME_OFFSET_GET(frameinfo2) << 5);
583  *rxframeoffset = 0;
584  *rxframeno = EOE_HDR_FRAME_NO_GET(frameinfo2);
585  }
586  else
587  {
588  /* If we're inside a frame, make sure it is the same */
589  if (*rxframeno != EOE_HDR_FRAME_NO_GET(frameinfo2))
590  {
591  *rxfragmentno = 0;
592  *rxframesize = 0;
593  *rxframeoffset = 0;
594  *rxframeno = 0;
596  return wkc;
597  }
598  else if (*rxframeoffset != (EOE_HDR_FRAME_OFFSET_GET(frameinfo2) << 5))
599  {
600  *rxfragmentno = 0;
601  *rxframesize = 0;
602  *rxframeoffset = 0;
603  *rxframeno = 0;
605  return wkc;
606  }
607  }
608 
609  /* Make sure we're inside expected frame size */
610  if (((*rxframeoffset + eoedatasize) <= *rxframesize) &&
611  ((*rxframeoffset + eoedatasize) <= *psize))
612  {
613  memcpy(&buf[*rxframeoffset], aEOEp->data, eoedatasize);
614  *rxframeoffset += eoedatasize;
615  *rxfragmentno += 1;
616  }
617 
618  /* Is it the last fragment */
619  if (EOE_HDR_LAST_FRAGMENT_GET(frameinfo1))
620  {
621  /* Remove timestamp */
622  if (EOE_HDR_TIME_APPEND_GET(frameinfo1))
623  {
624  *rxframeoffset -= 4;
625  }
626  *psize = *rxframeoffset;
627  *rxfragmentno = 0;
628  *rxframesize = 0;
629  *rxframeoffset = 0;
630  *rxframeno = 0;
631  wkc = 1;
632  }
633  }
634  else
635  {
636  /* unexpected mailbox received */
638  }
639  return wkc;
640 }
int ecx_EOEsetIp(ecx_contextt *context, uint16 slave, uint8 port, eoe_param_t *ipparam, int timeout)
Definition: ethercateoe.c:67
uint16_t rxframeno
Definition: eoe_test.c:49
#define EOE_HDR_LAST_FRAGMENT_GET(x)
Definition: ethercateoe.h:69
int ecx_EOEreadfragment(ec_mbxbuft *MbxIn, uint8 *rxfragmentno, uint16 *rxframesize, uint16 *rxframeoffset, uint16 *rxframeno, int *psize, void *p)
Definition: ethercateoe.c:534
uint8 mbx_cnt
Definition: ethercatmain.h:167
#define EOE_PARAM_MAC_INCLUDE
Definition: ethercateoe.h:95
#define EOE_INIT_REQ
Definition: ethercateoe.h:105
uint16_t rxframesize
Definition: eoe_test.c:45
uint8_t uint8
Definition: osal.h:28
#define EOE_ETHADDR_LENGTH
Definition: ethercateoe.h:24
#define EOE_GET_IP_PARAM_REQ
Definition: ethercateoe.h:109
Headerfile for all ethercat headers.
#define EOE_HDR_LAST_FRAGMENT_SET(x)
Definition: ethercateoe.h:68
unsigned short uint16_t
Definition: stdint.h:79
uint16_t uint16
Definition: osal.h:29
#define EOE_IP4_ADDR_TO_U32(ipaddr, a, b, c, d)
Definition: ethercateoe.h:54
unsigned char uint8_t
Definition: stdint.h:78
int(* EOEhook)(ecx_contextt *context, uint16 slave, void *eoembx)
Definition: ethercatmain.h:429
#define etohs(A)
Definition: ethercattype.h:536
#define TRUE
Definition: osal.h:19
#define EOE_HDR_TIME_APPEND_GET(x)
Definition: ethercateoe.h:73
#define EOE_HDR_LAST_FRAGMENT
Definition: ethercateoe.h:67
void ec_clearmbx(ec_mbxbuft *Mbx)
Definition: ethercatmain.c:921
#define EOE_RESULT_UNSUPPORTED_FRAME_TYPE
Definition: ethercateoe.h:117
static void EOE_ip_byte_to_uint32(uint8_t *byte_ip, eoe_ip4_addr_t *ip)
Definition: ethercateoe.c:37
#define EOE_HDR_FRAME_NO_SET(x)
Definition: ethercateoe.h:90
#define EOE_GET_IP_PARAM_RESP
Definition: ethercateoe.h:110
int ecx_EOEgetIp(ecx_contextt *context, uint16 slave, uint8 port, eoe_param_t *ipparam, int timeout)
Definition: ethercateoe.c:181
int ecx_mbxsend(ecx_contextt *context, uint16 slave, ec_mbxbuft *mbx, int timeout)
Definition: ethercatmain.c:968
#define EOE_PARAM_DNS_IP_INCLUDE
Definition: ethercateoe.h:99
#define EOE_PARAM_DEFAULT_GATEWAY_INCLUDE
Definition: ethercateoe.h:98
uint16_t rxframeoffset
Definition: eoe_test.c:47
#define EOE_HDR_FRAG_NO_SET(x)
Definition: ethercateoe.h:82
#define EC_TIMEOUTTXM
Definition: ethercattype.h:72
int ecx_mbxreceive(ecx_contextt *context, uint16 slave, ec_mbxbuft *mbx, int timeout)
#define EOE_HDR_FRAME_PORT_GET(x)
Definition: ethercateoe.h:65
int ecx_EOEsend(ecx_contextt *context, uint16 slave, uint8 port, int psize, void *p, int timeout)
Definition: ethercateoe.c:322
int slave
Definition: aliastool.c:44
#define FALSE
Definition: osal.h:22
PACKED_BEGIN struct PACKED ec_EOEt
#define EOE_HDR_FRAG_NO_GET(x)
Definition: ethercateoe.h:83
uint8_t rxfragmentno
Definition: eoe_test.c:43
#define eoe_ip4_addr1(ipaddr)
Definition: ethercateoe.h:48
#define EOE_RESULT_SUCCESS
Definition: ethercateoe.h:115
#define EOE_HDR_FRAME_NO_GET(x)
Definition: ethercateoe.h:91
#define EOE_PARAM_IP_INCLUDE
Definition: ethercateoe.h:96
#define eoe_ip4_addr3(ipaddr)
Definition: ethercateoe.h:50
#define EOE_HDR_FRAME_OFFSET_GET(x)
Definition: ethercateoe.h:87
#define EOE_PARAM_OFFSET
Definition: ethercateoe.h:94
#define EOE_DNS_NAME_LENGTH
Definition: ethercateoe.h:22
static void EOE_ip_uint32_to_byte(eoe_ip4_addr_t *ip, uint8_t *byte_ip)
Definition: ethercateoe.c:25
int wkc
Definition: aliastool.c:47
#define htoes(A)
Definition: ethercattype.h:533
#define eoe_ip4_addr2(ipaddr)
Definition: ethercateoe.h:49
#define EOE_INIT_RESP
Definition: ethercateoe.h:106
int ecx_EOErecv(ecx_contextt *context, uint16 slave, uint8 port, int *psize, void *p, int timeout)
Definition: ethercateoe.c:415
#define EOE_PARAM_SUBNET_IP_INCLUDE
Definition: ethercateoe.h:97
uint16 mbx_l
Definition: ethercatmain.h:157
#define EOE_HDR_FRAME_TYPE_SET(x)
Definition: ethercateoe.h:60
#define EOE_PARAM_DNS_NAME_INCLUDE
Definition: ethercateoe.h:100
#define EOE_HDR_FRAME_OFFSET_SET(x)
Definition: ethercateoe.h:86
PACKED_END struct eoe_param eoe_param_t
#define eoe_ip4_addr4(ipaddr)
Definition: ethercateoe.h:51
#define EOE_HDR_FRAME_PORT_SET(x)
Definition: ethercateoe.h:64
int ecx_EOEdefinehook(ecx_contextt *context, void *hook)
Definition: ethercateoe.c:52
#define EOE_HDR_FRAME_TYPE_GET(x)
Definition: ethercateoe.h:61
ec_slavet * slavelist
Definition: ethercatmain.h:389
uint8 ec_mbxbuft[EC_MAXMBX+1]
Definition: ethercatmain.h:312
uint8 ec_nextmbxcnt(uint8 cnt)
Definition: ethercatmain.c:907


soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Mon Feb 28 2022 23:46:57