IgH EtherCAT Master  1.5.2
foe_request.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * $Id$
4  *
5  * Copyright (C) 2008 Olav Zarges, imc Messsysteme GmbH
6  *
7  * This file is part of the IgH EtherCAT Master.
8  *
9  * The IgH EtherCAT Master is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License version 2, as
11  * published by the Free Software Foundation.
12  *
13  * The IgH EtherCAT Master is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16  * Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with the IgH EtherCAT Master; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  * ---
23  *
24  * The license mentioned above concerns the source code only. Using the
25  * EtherCAT technology and brand is only permitted in compliance with the
26  * industrial property and similar rights of Beckhoff Automation GmbH.
27  *
28  *****************************************************************************/
29 
35 /*****************************************************************************/
36 
37 #ifndef __EC_FOE_REQUEST_H__
38 #define __EC_FOE_REQUEST_H__
39 
40 #include <linux/list.h>
41 
42 #include "../include/ecrt.h"
43 
44 #include "globals.h"
45 
46 /*****************************************************************************/
47 
51  struct list_head list;
52  uint8_t *buffer;
53  size_t buffer_size;
54  size_t data_size;
55  size_t progress;
57  uint32_t issue_timeout;
59  uint32_t response_timeout;
65  unsigned long jiffies_start;
66  unsigned long jiffies_sent;
68  uint32_t password;
70  uint32_t error_code;
71  uint8_t file_name[255];
72 };
73 
74 /*****************************************************************************/
75 
78 
80 int ec_foe_request_copy_data(ec_foe_request_t *, const uint8_t *, size_t);
82 
83 /*****************************************************************************/
84 
85 #endif
uint32_t issue_timeout
Maximum time in ms, the processing of the request may take.
Definition: foe_request.h:57
ec_foe_error_t
FoE error enumeration type.
Definition: ecrt.h:548
void ec_foe_request_clear(ec_foe_request_t *)
FoE request destructor.
Definition: foe_request.c:79
size_t data_size
Size of FoE data.
Definition: foe_request.h:54
Global definitions and macros.
uint8_t file_name[255]
FoE filename.
Definition: foe_request.h:71
ec_internal_request_state_t
Generic request state.
Definition: globals.h:325
int ec_foe_request_alloc(ec_foe_request_t *, size_t)
Pre-allocates the data memory.
Definition: foe_request.c:112
uint32_t response_timeout
Maximum time in ms, the transfer is retried, if the slave does not respond.
Definition: foe_request.h:59
uint8_t * buffer
Pointer to FoE data.
Definition: foe_request.h:52
ec_direction_t
Direction type for PDO assignment functions.
Definition: ecrt.h:436
int ec_foe_request_copy_data(ec_foe_request_t *, const uint8_t *, size_t)
Copies FoE data from an external source.
Definition: foe_request.c:141
uint32_t error_code
Error code from an FoE Error Request.
Definition: foe_request.h:70
struct list_head list
List item.
Definition: foe_request.h:51
ec_foe_error_t result
FoE request abort code.
Definition: foe_request.h:69
ec_direction_t dir
Direction.
Definition: foe_request.h:61
size_t buffer_size
Size of FoE data memory.
Definition: foe_request.h:53
unsigned long jiffies_sent
Jiffies, when the upload/download request was sent.
Definition: foe_request.h:66
unsigned long jiffies_start
Jiffies, when the request was issued.
Definition: foe_request.h:65
int ec_foe_request_timed_out(const ec_foe_request_t *)
Checks, if the timeout was exceeded.
Definition: foe_request.c:165
size_t progress
Current position of a BUSY request.
Definition: foe_request.h:55
void ec_foe_request_init(ec_foe_request_t *)
FoE request constructor.
Definition: foe_request.c:56
FoE request.
Definition: foe_request.h:50
uint32_t password
FoE password.
Definition: foe_request.h:68
ec_internal_request_state_t state
FoE request state.
Definition: foe_request.h:64