iCub-main
Loading...
Searching...
No Matches
abstractEthResource.h
Go to the documentation of this file.
1// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2
3/*
4 * Copyright (C) 2017 iCub Facility - Istituto Italiano di Tecnologia
5 * Author: Valentina Gaggero
6 * email: valentina.gaggero@iit.it
7 * website: www.robotcub.org
8 * Permission is granted to copy, distribute, and/or modify this program
9 * under the terms of the GNU General Public License, version 2 or any
10 * later version published by the Free Software Foundation.
11 *
12 * A copy of the license can be found at
13 * http://www.robotcub.org/icub/license/gpl.txt
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
18 * Public License for more details
19*/
20
21// - include guard ----------------------------------------------------------------------------------------------------
22
23#ifndef _ABSTRACTETHRESOURCE_H_
24#define _ABSTRACTETHRESOURCE_H_
25
26
27#include "EoProtocol.h"
28#include <vector>
29#include <yarp/os/Searchable.h>
30
31
32#include "hostTransceiver.hpp"
34
35
36using namespace std;
37
38
39namespace eth {
40
42 {
43 public:
44
46 {
47 eOipv4addr_t ipv4addr;
48 eOipv4addressing_t ipv4addressing;
49 eObrd_ethtype_t boardtype;
50 eOversion_t firmwareversion;
51 eOdate_t firmwaredate;
58 };
59
60 //AbstractEthResource();
61 // virtual ~AbstractEthResource() = 0;
62
63
64 virtual bool open2(eOipv4addr_t remIP, yarp::os::Searchable &cfgtotal) = 0;
65 virtual bool close() = 0;
66
67
68 virtual const Properties & getProperties() = 0;
69
70
71 virtual const void * getUDPtransmit(eOipv4addressing_t &destination, size_t &sizeofpacket, uint16_t &numofrops) = 0;
72
73 virtual bool processRXpacket(const void *data, const size_t size) = 0;
74
75 virtual bool getRemoteValue(const eOprotID32_t id32, void *value, const double timeout = 0.100, const unsigned int retries = 0) = 0;
76
77 virtual bool getRemoteValues(const std::vector<eOprotID32_t> &id32s, const std::vector<void*> &values, const double timeout = 0.500) = 0;
78
79 virtual bool setRemoteValue(const eOprotID32_t id32, void *value) = 0;
80
81 virtual bool setcheckRemoteValue(const eOprotID32_t id32, void *value, const unsigned int retries = 10, const double waitbeforecheck = 0.001, const double timeout = 0.050) = 0;
82
83 virtual bool getLocalValue(const eOprotID32_t id32, void *value) = 0;
84
85 virtual bool setLocalValue(eOprotID32_t id32, const void *value, bool overrideROprotection = false) = 0;
86
87 virtual bool verifyEPprotocol(eOprot_endpoint_t ep) = 0;
88
89 virtual bool CANPrintHandler(eOmn_info_basic_t* infobasic) = 0;
90
91 virtual bool serviceVerifyActivate(eOmn_serv_category_t category, const eOmn_serv_parameter_t* param, double timeout = 0.500) = 0;
92
93 virtual bool serviceSetRegulars(eOmn_serv_category_t category, vector<eOprotID32_t> &id32vector, double timeout = 0.500) = 0;
94
95 virtual bool serviceStart(eOmn_serv_category_t category, double timeout = 0.500) = 0;
96
97 virtual bool serviceStop(eOmn_serv_category_t category, double timeout = 0.500) = 0;
98
99 virtual bool Tick() = 0;
100 virtual bool Check() = 0;
101
102 virtual bool isFake() = 0;
103
105
106 protected:
108
109 };
110
111} // namespace eth
112
113
114#endif // include-guard
115
116
117// - end-of-file (leave a blank line after)----------------------------------------------------------------------------
118
119
120
121
122
123
124
@ data
virtual bool isFake()=0
virtual bool setcheckRemoteValue(const eOprotID32_t id32, void *value, const unsigned int retries=10, const double waitbeforecheck=0.001, const double timeout=0.050)=0
POSServiceConfiguration posServiceConfiguration
virtual bool close()=0
virtual const void * getUDPtransmit(eOipv4addressing_t &destination, size_t &sizeofpacket, uint16_t &numofrops)=0
virtual bool serviceVerifyActivate(eOmn_serv_category_t category, const eOmn_serv_parameter_t *param, double timeout=0.500)=0
virtual bool Tick()=0
virtual HostTransceiver * getTransceiver()=0
virtual const Properties & getProperties()=0
virtual bool setRemoteValue(const eOprotID32_t id32, void *value)=0
virtual bool verifyEPprotocol(eOprot_endpoint_t ep)=0
virtual bool getLocalValue(const eOprotID32_t id32, void *value)=0
virtual bool setLocalValue(eOprotID32_t id32, const void *value, bool overrideROprotection=false)=0
virtual bool serviceStop(eOmn_serv_category_t category, double timeout=0.500)=0
virtual bool serviceSetRegulars(eOmn_serv_category_t category, vector< eOprotID32_t > &id32vector, double timeout=0.500)=0
virtual bool processRXpacket(const void *data, const size_t size)=0
virtual bool serviceStart(eOmn_serv_category_t category, double timeout=0.500)=0
virtual bool getRemoteValue(const eOprotID32_t id32, void *value, const double timeout=0.100, const unsigned int retries=0)=0
virtual bool getRemoteValues(const std::vector< eOprotID32_t > &id32s, const std::vector< void * > &values, const double timeout=0.500)=0
virtual bool CANPrintHandler(eOmn_info_basic_t *infobasic)=0
virtual bool Check()=0
virtual bool open2(eOipv4addr_t remIP, yarp::os::Searchable &cfgtotal)=0