Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//=============================================================================
// TimIQTypesAndConsts.h
//=============================================================================
// abstraction.......Basic types and Constants for TimIQ library
// class.............Basic structures
// original author...J. GOUNO - NEXEYA-FRANCE
//=============================================================================
#ifndef _TIMIQ_TYPES_AND_CONSTS_H_
#define _TIMIQ_TYPES_AND_CONSTS_H_
//=============================================================================
// DEPENDENCIES
//=============================================================================
namespace TIMIQLib_ns
{
// ============================================================================
// CONSTANTS
// ============================================================================
//- web protocol: http
const std::string kHTTP_WEB_PROTOCOL = "http://";
//- Web page: data
//----------------------
const std::string kTIMIQ_DATA_PAGE= "/get_data.wsgi";
const std::string kTIMIQ_DATA_KEY= "data";
//- Web page: IValue
//----------------------
const std::string kTIMIQ_IVALUE_PAGE= "/set_iValue.wsgi";
const std::string kTIMIQ_IVALUE_KEY= "iValue";
//- Web page: QValue
//----------------------
const std::string kTIMIQ_QVALUE_PAGE= "/set_qValue.wsgi";
const std::string kTIMIQ_QVALUE_KEY= "qValue";
//- Web page: boardTemperature
//------------------------------
const std::string kTIMIQ_BOARD_TEMPERATURE_PAGE= "/set_boardTemperature.wsgi";
const std::string kTIMIQ_BOARD_TEMPERATURE_KEY= "boardTemperature";
//- Web page: command
//----------------------
const std::string kTIMIQ_COMMAND_PAGE= "/set_command.wsgi";
const std::string kTIMIQ_COMMAND_KEY= "command";
//- Web page: feedback
//-------------------------
const std::string kTIMIQ_FEEDBACK_PAGE= "/get_feedback.wsgi";
//- mixerCosOutput key
const std::string kTIMIQ_MIXER_COS_OUTPUT_KEY= "mixerCosOutput";
//- mixerSinOutput key
const std::string kTIMIQ_MIXER_SIN_OUTPUT_KEY= "mixerSinOutput";
//- Web page: state
//-------------------------
const std::string kTIMIQ_STATE_PAGE= "/get_state.wsgi";
//- message key
const std::string kTIMIQ_MESSAGE_KEY= "message=";
//- state key
const std::string kTIMIQ_STATE_KEY= "state=";
//- state code
const std::string kTIMIQ_CODE_KEY= "code=";
//- buffer key size
// ============================================================================
// TYPES
// ============================================================================
//- TimIQ library error numbers
typedef enum {
// No error occurred
timiq_NO_ERROR = 0,
// timIQ errors
timiq_internal_ERROR
}E_timiq_errno_t;
//- TimIQsSystem codes
typedef enum
{
Error = 0,
OK,
Busy,
} E_timiq_code_t;
//- TimIQsSystem commands
typedef enum
{
RESET_SYSTEM = 1,
RECALIBRATE_PLL,
ACKNOWLEDGE_ERRORS
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
//------------------------------
//- timIQ struct config
//------------------------------
typedef enum
{
Undef = 0,
TI_IVAL,
TI_QVAL,
TI_BTEMP,
TI_DATA
} E_ti_t;
typedef struct timIQConfig
{
E_ti_t id;
float value;
E_timiq_errno_t ti_err;
//- default constructor -----------------------
timIQConfig()
: id(Undef),
value(0.0),
ti_err(timiq_NO_ERROR)
{
};
//- destructor -----------------------
~timIQConfig ()
{
}
//- copy constructor ------------------
timIQConfig (const timIQConfig& src)
{
*this = src;
}
//- operator= ------------------
const timIQConfig & operator= (const timIQConfig& src)
{
if (this == & src)
return *this;
this->id = src.id;
this->value = src.value;
this->ti_err = src.ti_err;
return *this;
}
//- dump -----------------------
void dump () const
{
std::cout << "timIQConfig::id........."
<< this->id
<< std::endl;
std::cout << "timIQConfig::value........."
<< this->value
<< std::endl;
}
}timIQConfig_t;