libethercat - an embeddable realtime EtherCAT-master library
Communicate with EtherCAT slaves attached to a Network interface.
Loading...
Searching...
No Matches
hw_sock_raw.h
Go to the documentation of this file.
1
12/*
13 * This file is part of libethercat.
14 *
15 * libethercat is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 3 of the License, or (at your option) any later version.
19 *
20 * libethercat is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with libethercat (LICENSE.LGPL-V3); if not, write
27 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
28 * Floor, Boston, MA 02110-1301, USA.
29 *
30 * Please note that the use of the EtherCAT technology, the EtherCAT
31 * brand name and the EtherCAT logo is only permitted if the property
32 * rights of Beckhoff Automation GmbH are observed. For further
33 * information please contact Beckhoff Automation GmbH & Co. KG,
34 * Hülshorstweg 20, D-33415 Verl, Germany (www.beckhoff.com) or the
35 * EtherCAT Technology Group, Ostendstraße 196, D-90482 Nuremberg,
36 * Germany (ETG, www.ethercat.org).
37 *
38 */
39
40#ifndef LIBETHERCAT_HW_SOCK_RAW_H
41#define LIBETHERCAT_HW_SOCK_RAW_H
42
43#include <libethercat/hw.h>
44#include <libethercat/ec.h>
45#include <libosal/task.h>
46
47typedef struct hw_sock_raw {
48 struct hw_common common;
49
50 int sockfd;
51
52 osal_uint8_t send_frame[ETH_FRAME_LEN];
53 osal_uint8_t recv_frame[ETH_FRAME_LEN];
54
55 // receiver thread settings
56 osal_task_t rxthread;
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
65
74int hw_device_sock_raw_open(struct hw_sock_raw *phw, struct ec *pec, const osal_char_t *devname, int prio, int cpu_mask);
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif // LIBETHERCAT_HW_SOCK_RAW_H
81
ethercat master functions.
hardware access functions
int hw_device_sock_raw_open(struct hw_sock_raw *phw, struct ec *pec, const osal_char_t *devname, int prio, int cpu_mask)
Opens EtherCAT hw device.
ethercat master structure
Definition ec.h:188
hardware structure
Definition hw.h:123
struct ec * pec
Pointer to EtherCAT master structure.
Definition hw.h:124
Definition hw_sock_raw.h:47
osal_task_t rxthread
receiver thread handle
Definition hw_sock_raw.h:56
osal_uint8_t recv_frame[ETH_FRAME_LEN]
Static receive frame.
Definition hw_sock_raw.h:53
int rxthreadrunning
receiver thread running flag
Definition hw_sock_raw.h:57
int sockfd
raw socket file descriptor
Definition hw_sock_raw.h:50
osal_uint8_t send_frame[ETH_FRAME_LEN]
Static send frame.
Definition hw_sock_raw.h:52