Convert a number to uint64_t doesn't work

Dear support

I need to pass 128 bits service uuid to discovery process as variable, I have an array of 16 bytes of uuid number, it is divided into five parts as show here

BT_UUID_128_ENCODE(w32, w1, w2, w3, w48)
where w48 is 48 bits number to pass to, so I have to define a uint16_t variable(w48) to hold it,  and convert from my byte array (value[ ]) as show below:
uint64_t w48;
w48 = value[10]<<40 + value[11]<<32;   //this line ends up 0
w48 += value[12]<<24+value[13]<<16;
w48 +=value[14]<<8 + value[15];
But the first line doesn't work, it ends up 0, while the other 2 lines works individually. let me know what I can do please?
Thank you!
Ping
Parents Reply Children
Related