Re: [PATCH BlueZ 3/4] test/test-mesh: Generate correct value for Device UUID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
> 

-- 
Michał Lowas-Rzechonek <michal.lowas-rzechonek@xxxxxxxxxxx>
Silvair http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux