Commit fbfaf3b8 authored by Michał Więckowski's avatar Michał Więckowski Committed by Kishen Maloor

Display UUID of device for automation purpose

parent 4b76a1df
Pipeline #600 failed with stage
in 2 minutes and 43 seconds
......@@ -15,6 +15,7 @@
*/
#include "oc_api.h"
#include "oc_core_res.h"
#include "oc_pki.h"
#include "port/oc_clock.h"
#include <pthread.h>
......@@ -706,6 +707,15 @@ factory_presets_cb(size_t device, void *data)
#endif /* OC_SECURITY && OC_PKI */
}
void
display_device_uuid(void)
{
char buffer[OC_UUID_LEN];
oc_uuid_to_str(oc_core_get_device_id(0), buffer, sizeof(buffer));
PRINT("Started device with ID: %s\n", buffer);
}
int
main(void)
{
......@@ -744,6 +754,7 @@ main(void)
init = oc_main_init(&handler);
if (init < 0)
return init;
display_device_uuid();
PRINT("Waiting for Client...\n");
PRINT("Hit 'Enter' at any time to toggle switch resource\n");
while (quit != 1) {
......
......@@ -1689,6 +1689,15 @@ discover_resources(void)
otb_mutex_unlock(app_sync_lock);
}
void
display_device_uuid()
{
char buffer[OC_UUID_LEN];
oc_uuid_to_str(oc_core_get_device_id(0), buffer, sizeof(buffer));
PRINT("Started device with ID: %s\n", buffer);
}
int
main(void)
{
......@@ -1732,6 +1741,8 @@ main(void)
}
#endif
display_device_uuid();
int c;
while (quit != 1) {
display_menu();
......
Markdown is supported
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