iCub-main
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"
33 
34 
35 using namespace std;
36 
37 
38 namespace eth {
39 
41  {
42  public:
43 
44  struct Properties
45  {
46  eOipv4addr_t ipv4addr;
47  eOipv4addressing_t ipv4addressing;
48  eObrd_ethtype_t boardtype;
49  eOversion_t firmwareversion;
50  eOdate_t firmwaredate;
56  };
57 
58  //AbstractEthResource();
59  // virtual ~AbstractEthResource() = 0;
60 
61 
62  virtual bool open2(eOipv4addr_t remIP, yarp::os::Searchable &cfgtotal) = 0;
63  virtual bool close() = 0;
64 
65 
66  virtual const Properties & getProperties() = 0;
67 
68 
69  virtual const void * getUDPtransmit(eOipv4addressing_t &destination, size_t &sizeofpacket, uint16_t &numofrops) = 0;
70 
71  virtual bool processRXpacket(const void *data, const size_t size) = 0;
72 
73  virtual bool getRemoteValue(const eOprotID32_t id32, void *value, const double timeout = 0.100, const unsigned int retries = 0) = 0;
74 
75  virtual bool getRemoteValues(const std::vector<eOprotID32_t> &id32s, const std::vector<void*> &values, const double timeout = 0.500) = 0;
76 
77  virtual bool setRemoteValue(const eOprotID32_t id32, void *value) = 0;
78 
79  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;
80 
81  virtual bool getLocalValue(const eOprotID32_t id32, void *value) = 0;
82 
83  virtual bool setLocalValue(eOprotID32_t id32, const void *value, bool overrideROprotection = false) = 0;
84 
85  virtual bool verifyEPprotocol(eOprot_endpoint_t ep) = 0;
86 
87  virtual bool CANPrintHandler(eOmn_info_basic_t* infobasic) = 0;
88 
89  virtual bool serviceVerifyActivate(eOmn_serv_category_t category, const eOmn_serv_parameter_t* param, double timeout = 0.500) = 0;
90 
91  virtual bool serviceSetRegulars(eOmn_serv_category_t category, vector<eOprotID32_t> &id32vector, double timeout = 0.500) = 0;
92 
93  virtual bool serviceStart(eOmn_serv_category_t category, double timeout = 0.500) = 0;
94 
95  virtual bool serviceStop(eOmn_serv_category_t category, double timeout = 0.500) = 0;
96 
97  virtual bool Tick() = 0;
98  virtual bool Check() = 0;
99 
100  virtual bool isFake() = 0;
101 
103 
104  };
105 
106 } // namespace eth
107 
108 
109 #endif // include-guard
110 
111 
112 // - end-of-file (leave a blank line after)----------------------------------------------------------------------------
113 
114 
115 
116 
117 
118 
119 
@ data
virtual bool isFake()=0
virtual const Properties & getProperties()=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
virtual const void * getUDPtransmit(eOipv4addressing_t &destination, size_t &sizeofpacket, uint16_t &numofrops)=0
virtual bool close()=0
virtual bool serviceVerifyActivate(eOmn_serv_category_t category, const eOmn_serv_parameter_t *param, double timeout=0.500)=0
virtual HostTransceiver * getTransceiver()=0
virtual bool Tick()=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