Commit 2fd3600e authored by Axel Auweter's avatar Axel Auweter
Browse files

Merge remote-tracking branch 'origin/master' into ticket-21

parents f19bdab4 5e58431b
......@@ -84,15 +84,16 @@ void mqttCallback(SimpleMQTTMessage *msg)
#if 0
cout << "Topic decode successful:"
<< "\nRaw: " << sid.raw[0] << " " << sid.raw[1]
<< "\ndatacenter_id: " << hex << (uint32_t)sid.dl.datacenter_id
<< "\ncluster_id: " << hex << (uint32_t)sid.dl.cluster_id
<< "\nrack_id_msb: " << hex << (uint32_t)sid.dl.rack_id_msb
<< "\nrack_id_lsb: " << hex << (uint32_t)sid.dl.rack_id_lsb
<< "\nchassis_id: " << hex << (uint32_t)sid.dl.chassis_id
<< "\nbmc_id: " << hex << (uint32_t)sid.dl.bmc_id
<< "\nsdb_id: " << hex << (uint32_t)sid.dl.sdb_id
<< "\ndevice_id: " << hex << sid.dsid.device_id
<< "\nsensor_id: " << hex << sid.dsid.sensor_id
<< "\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";
#endif
......@@ -139,7 +140,7 @@ int main(int argc, char* const argv[]) {
/*
* Allocate and initialize sensor data store.
*/
mySensorDataStore = new SensorDataStore();
mySensorDataStore = new SensorDataStore("127.0.0.1", 9160);
/*
* Start the MQTT Message Server.
......
......@@ -69,7 +69,7 @@ bool SensorDataStoreImpl::topicToSid(SensorId* sid, std::string topic)
const char* buf = topic.c_str();
sid->raw[0] = 0;
sid->raw[1] = 0;
while (*buf) {
while (*buf && pos < 128) {
if (*buf >= '0' && *buf <= '9') {
sid->raw[pos / 64] |= (((uint64_t)(*buf - '0')) << (60-(pos%64)));
pos += 4;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment