Message ID | 20210211222143.39986-4-inga.stotland@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Use compliant UUID for mesh | expand |
On 02/11, Inga Stotland wrote: > This ensures that the value of Device UUID when invoking > Join method is compliant with RFC 4122. > --- > test/test-mesh | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/test/test-mesh b/test/test-mesh > index 9e4783734..a478843a3 100755 > --- a/test/test-mesh > +++ b/test/test-mesh > @@ -889,6 +889,11 @@ class MainMenu(Menu): > > uuid = bytearray.fromhex("0a0102030405060708090A0B0C0D0E0F") > random.shuffle(uuid) > + uuid[6] &= 0x0f; > + uuid[6] |= 4 << 4; > + uuid[8] &= 0x3f; > + uuid[8] |= 0x80; > + https://docs.python.org/3/library/uuid.html > uuid_str = array_to_string(uuid) > > print(set_yellow('Joining with UUID ') + set_green(uuid_str)) > -- > 2.26.2 >
diff --git a/test/test-mesh b/test/test-mesh index 9e4783734..a478843a3 100755 --- a/test/test-mesh +++ b/test/test-mesh @@ -889,6 +889,11 @@ class MainMenu(Menu): uuid = bytearray.fromhex("0a0102030405060708090A0B0C0D0E0F") random.shuffle(uuid) + uuid[6] &= 0x0f; + uuid[6] |= 4 << 4; + uuid[8] &= 0x3f; + uuid[8] |= 0x80; + uuid_str = array_to_string(uuid) print(set_yellow('Joining with UUID ') + set_green(uuid_str))