spand
04/25/2017, 9:34 AM.toByte()
you can just call .map()
To get rid of the many 0xFF
then I guess you can specify it in Longs 0xFF_FF_FF_FF_FF_FF_FF
and convert to bytes.
Im not sure additional syntex is needed.. seems a util package for bits and bytes could take care of most of itlouiscad
04/25/2017, 9:38 AM.map()
si still an extra call that has nothing to do with bytes, and this method doesn't exist in stdlib.louiscad
04/25/2017, 9:41 AM0xFF_FF_FF_FF_FF_FF_FF
for UUIDs, but it didn't work because it's treated as a positive, 65 bits value, which is beyond the 64 bits of Long
, causing a compilation error, and guess what... It still doesn't work, and the .toLong()
ugly workaround doesn't work because there's no way to represent the 65 bits constant in first placelouiscad
04/25/2017, 9:43 AMlouiscad
04/25/2017, 9:44 AMspand
04/25/2017, 9:48 AMlouiscad
04/25/2017, 9:54 AMg
or any other non hex character, and you would notice it only when that part of the code is run, which is not ideal to test since when you work with bluetooth, it's impossible to unit test communication between devices. Also, there's the issue with uppercase and lowercase characters which either introduce more overhead to let both work, or are more error prone if you allow only uppercase, or only lowercase