129 ostringstream dev_number_string;
130 dev_number_string << setw(3) << setfill(
'0') << telem_num;
133 request =
"getvalue {\"device_telem_" + type +
"_" + dev_number_string.str() +
"\"}";
145 if (type ==
"vuint8"){
146 uint8_t value =
agent.cdata->devspec.telem[telem_num]->vuint8;
151 if (type ==
"vint8"){
152 int8_t value=
agent.cdata->devspec.telem[telem_num]->vint8;
157 if (type ==
"vuint16"){
158 uint16_t value=
agent.cdata->devspec.telem[telem_num]->vuint16;
163 if (type ==
"vint16"){
164 int16_t value=
agent.cdata->devspec.telem[telem_num]->vint16;
169 if (type ==
"vuint32"){
170 uint32_t value=
agent.cdata->devspec.telem[telem_num]->vuint32;
175 if (type ==
"vint32"){
176 int32_t value=
agent.cdata->devspec.telem[telem_num]->vint32;
181 if (type ==
"vfloat"){
182 float value=
agent.cdata->devspec.telem[telem_num]->vfloat;
187 if (type ==
"vdouble"){
188 double value=
agent.cdata->devspec.telem[telem_num]->vdouble;
193 if (type ==
"vstring"){
194 value_str = string(
agent.cdata->devspec.telem[telem_num]->vstring);
198 if ( response.size() > 1){
201 cout <<
"rx telem stream #" << telem_num
202 <<
" (" << type <<
") \t : " << value_str << endl;
206 if (type ==
"vuint8"){
207 agent.cdata->devspec.telem[telem_num]->vuint8 ++;
208 value_str =
to_string(
agent.cdata->devspec.telem[telem_num]->vuint8);
211 if (type ==
"vint8"){
212 agent.cdata->devspec.telem[telem_num]->vint8 ++;
213 value_str =
to_string(
agent.cdata->devspec.telem[telem_num]->vint8);
216 if (type ==
"vuint16"){
217 agent.cdata->devspec.telem[telem_num]->vuint16 ++;
218 value_str =
to_string(
agent.cdata->devspec.telem[telem_num]->vuint16);
221 if (type ==
"vint16"){
222 agent.cdata->devspec.telem[telem_num]->vint16 ++;
223 value_str =
to_string(
agent.cdata->devspec.telem[telem_num]->vint16);
226 if (type ==
"vuint32"){
227 agent.cdata->devspec.telem[telem_num]->vuint32 ++;
228 value_str =
to_string(
agent.cdata->devspec.telem[telem_num]->vuint32);
231 if (type ==
"vint32"){
232 agent.cdata->devspec.telem[telem_num]->vint32 ++;
233 value_str =
to_string(
agent.cdata->devspec.telem[telem_num]->vint32);
236 if (type ==
"vfloat"){
237 agent.cdata->devspec.telem[telem_num]->vfloat += 0.1;
238 value_str =
to_string(
agent.cdata->devspec.telem[telem_num]->vfloat);
241 if (type ==
"vdouble"){
242 agent.cdata->devspec.telem[telem_num]->vdouble += 0.1;
243 value_str =
to_string(
agent.cdata->devspec.telem[telem_num]->vdouble);
246 if (type ==
"vstring"){
251 sprintf(
agent.cdata->devspec.telem[telem_num]->vstring,
"\"str%u\"",
itemp);
252 value_str = string(
agent.cdata->devspec.telem[telem_num]->vstring);
258 request =
"setvalue {\"device_telem_"+type+
"_" 259 + dev_number_string.str() +
"\":" int32_t json_parse(string jstring, cosmosstruc *cinfo)
Parse JSON using Name Space.
Definition: jsonlib.cpp:4799
string to_string(char *value)
Definition: stringlib.cpp:220
int iretn
Definition: rw_test.cpp:37
uint32_t itemp
Definition: agent_generic_device_test.cpp:52
beatstruc beat_agent_neighbour
Definition: agent_generic_device_test.cpp:53
Agent agent
Definition: agent_generic_device_test.cpp:48