Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
8e6686c1
Commit
8e6686c1
authored
Nov 09, 2017
by
Michael Ott
Browse files
Update debug output for MQTT parsing to current data layout
parent
dac94862
Changes
1
Hide whitespace changes
Inline
Side-by-side
CollectAgent/collectagent.cpp
View file @
8e6686c1
...
...
@@ -143,6 +143,7 @@ void mqttCallback(SimpleMQTTMessage *msg)
}
//...otherwise this message is malformed -> ignore...
else
{
cout
<<
"Message malformed
\n
"
;
delete
msg
;
return
;
}
...
...
@@ -155,23 +156,23 @@ void mqttCallback(SimpleMQTTMessage *msg)
DCDB
::
SensorId
sid
;
if
(
sid
.
mqttTopicConvert
(
msg
->
getTopic
()))
{
#if 0
cout << "Topic decode successful:"
<< "\nRaw: " << hex << setw(16) << setfill('0') << sid.raw[0] << " " << hex << setw(16) << setfill('0') << sid.raw[1]
<< "\ndatacenter_id: " << hex << ((sid.dl & 0xFF00000000000000) >> 56)
<< "\ncluster_id: " << hex << ((sid.dl & 0x00FF000000000000) >> 48)
<< "\nrack_id: " << hex << ((sid.dl & 0x0000FFFF00000000) >> 32)
<< "\nchassis_id: " << hex << ((sid.dl & 0x00000000FF000000) >> 24)
<< "\nbic_id: " << hex << ((sid.dl & 0x0000000000FF0000) >> 16)
<< "\nbmc_id: " << hex << ((sid.dl & 0x000000000000FF00) >> 8)
<< "\nknc_id: " << hex << ((sid.dl & 0x00000000000000FF))
<< "\ndevice_id: " << hex << sid.dsid.device_id
<< "\nreserved: " << hex << sid.dsid.rsvd
<< "\nsensor_number: " << hex << sid.dsid.sensor_number
<< "\n";
cout << "Topic decode successful:" << endl
<< " Raw: " << hex << setw(16) << setfill('0') << sid.getRaw()[0] << hex << setw(16) << setfill('0') << sid.getRaw()[1] << endl
<< " DeviceLocation: " << hex << setw(16) << setfill('0') << sid.getDeviceLocation() << endl
<< " device_id: " << hex << setw(8) << setfill('0') << sid.getDeviceSensorId().device_id << endl
<< " reserved: " << hex << setw(4) << setfill('0') << sid.getDeviceSensorId().rsvd << endl
<< " sensor_number: " << hex << setw(4) << setfill('0') << sid.getDeviceSensorId().sensor_number << endl << dec;
cout << "Payload (" << len/sizeof(mqttPayload) << " messages):"<< endl;
for (uint64_t i=0; i<len/sizeof(mqttPayload); i++) {
cout << " " << i << ": ts=" << payload[i].timestamp << " val=" << payload[i].value << endl;
}
cout << endl;
#endif
for
(
uint64_t
i
=
0
;
i
<
len
/
sizeof
(
mqttPayload
);
i
++
)
{
mySensorDataStore
->
insert
(
&
sid
,
payload
[
i
].
timestamp
,
payload
[
i
].
value
);
mySensorCache
.
storeSensor
(
sid
,
payload
[
i
].
timestamp
,
payload
[
i
].
value
);
}
//mySensorCache.dump();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment