This simplifies identifying the target elevator when there are multiple
of them running.
Also, remove hardcoded device ID in the configuration file so multiple
servers don't conflict.
Change-Id: I18b318c844e769529ae9f50e79ff85114a9f5b6d
Signed-off-by: Soemin Tjong <stjong@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18489
Reviewed-by: Way Vadhanasin <wayvad@microsoft.com>
Reviewed-by: Ibrahim Esmat <iesmat@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
}
]
},
- "rowneruuid" : "E068A3E6-90EF-4A26-A75F-9B098D43F54D"
+ "rowneruuid" : ""
},
"pstat": {
"isop": false,
- "deviceuuid": "E068A3E6-90EF-4A26-A75F-9B098D43F54D",
- "rowneruuid": "E068A3E6-90EF-4A26-A75F-9B098D43F54D",
+ "deviceuuid": "",
+ "rowneruuid": "",
"cm": 2,
"tm": 0,
"om": 4,
"oxmsel": 0,
"sct": 1,
"owned": false,
- "deviceuuid": "E068A3E6-90EF-4A26-A75F-9B098D43F54D",
+ "deviceuuid": "",
"devowneruuid": "",
- "rowneruuid": "E068A3E6-90EF-4A26-A75F-9B098D43F54D"
+ "rowneruuid": ""
}
}
std::bind(&ElevatorServer::ElevatorEntityHandler, this, _1),
OC_DISCOVERABLE | OC_OBSERVABLE | OC_SECURE);
+
+ if (result == OC_STACK_OK)
+ {
+ const char* deviceID = OCGetServerInstanceIDString();
+ std::cout << "Elevator server's device ID: ";
+ if (deviceID != nullptr)
+ {
+ std::cout << deviceID << std::endl;
+ }
+ else
+ {
+ std::cout << "Unknown" << std::endl;
+ }
+ }
+
return (result == OC_STACK_OK);
}