iCub-main
FeatureInterface.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 iCub Facility, Istituto Italiano di Tecnologia
3  * Authors: Alberto Cardellino
4  * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
5  *
6  */
7 
8 
9 #ifndef FEATUREINTERFACE_H_
10 #define FEATUREINTERFACE_H_
11 
12 
13 
14 #include <stdint.h>
15 typedef uint8_t fakestdbool_t;
16 #define fakestdbool_true 1
17 #define fakestdbool_false 0
18 
19 #include <string.h>
20 
21 extern void eo_receiver_callback_incaseoferror_in_sequencenumberReceived(uint64_t rec_seqnum, uint64_t expected_seqnum);
22 
23 #ifdef WIN32
24 // #pragma warning(disable:4355)
25 #endif
26 
27 #include "EoCommon.h"
28 #include "EoProtocol.h"
29 
30 #define FEAT_SIZE_INFO 128
31 
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36 
37 
38 
39 typedef enum
40 {
41  Management = 0x00,
42  AnalogMais = 0x01,
43  AnalogStrain = 0x02,
44  MotionControl = 0x03,
45  Skin = 0x04
47 
48 
49 typedef struct
50 {
51  uint16_t port;
52  int ip1,ip2,ip3,ip4;
53  char string[64];
54 } FEAT_ip_addr;
55 
56 typedef uint8_t FEAT_boardnumber_t; // boards are numbered in range [1, maxnum]. moreover 0xff is the invalid value.
57 #define FEAT_boardnumber_dummy 0xff
58 
60 typedef struct
61 {
63  eOprotEndpoint_t ep;
64  void *handle;
65 
68 
69  // Following are additional and optional info for debug, DO NOT COUNT ON THEM as identifiers for searches!!
70  // They may be removed very soon!
72  char name[FEAT_SIZE_INFO];
73 } FEAT_ID;
74 
75 
76 #ifdef _SETPOINT_TEST_
77 
78 #include "EoMeasures.h" // to see: eOmeas_position_t
79 
80 typedef enum
81 {
82  proccessed_all_rec_pkt = 0,
83  reached_cfgmaxnumofRXpackets = 1,
84  error_in_reception = 2,
85  rx_phase_finished = 3
86 } exit_rx_phase_contitions_t;
87 
88 typedef struct
89 {
90  eOabstime_t time; // 8B
91  eOmeas_position_t setpoint; // 4B
92  uint8_t numofrecpkt; // num of pkt(ropframe) received
93  uint8_t numofprocesspkt; // num of pkt (ropframe) processed
94  int8_t exit_cond;
95  uint8_t diff_packets;
96 } setpoint_test_data_t;
97 
98 void check_received_debug_data(FEAT_ID *id, int jointNum, setpoint_test_data_t *test_data_ptr);
99 #endif
100 
101 void initCallback(void *p);
102 
103 //fakestdbool_t addEncoderTimeStamp(FEAT_ID *id, int jointNum);
104 //fakestdbool_t findAndFill(FEAT_ID *id, void *sk_array, eOprotID32_t id32);
105 //fakestdbool_t handle_AS_data(FEAT_ID *id, void *as_array, eOprotID32_t id32);
106 
108 //void * get_MChandler_fromEP(FEAT_boardnumber_t boardnum, eOprotEndpoint_t ep);
109 
110 //fakestdbool_t MCmutex_post(void * p, uint32_t prognum);
111 
113 //FEAT_boardnumber_t nvBoardNum2FeatIdBoardNum(eOprotBRD_t nvboardnum);
114 
115 eOprotBRD_t featIdBoardNum2nvBoardNum(FEAT_boardnumber_t fid_boardnum);
116 
117 //double feat_yarp_time_now(void);
118 
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif /* FEATUREINTERFACE_H_ */
125 
126 
127 // eof
128 
129 
130 
131 
degrees time
Definition: sine.m:5
void * handle
FeatureType type
FEAT_ip_addr EMSipAddr
FEAT_boardnumber_t boardNum
eOprotEndpoint_t ep
FEAT_ip_addr PC104ipAddr
uint8_t FEAT_boardnumber_t
#define FEAT_SIZE_INFO
void initCallback(void *p)
uint8_t fakestdbool_t
FeatureType
@ AnalogMais
@ Skin
@ MotionControl
@ AnalogStrain
@ Management
void eo_receiver_callback_incaseoferror_in_sequencenumberReceived(uint64_t rec_seqnum, uint64_t expected_seqnum)
eOprotBRD_t featIdBoardNum2nvBoardNum(FEAT_boardnumber_t fid_boardnum)