Open tbrennanw0rk opened 9 years ago
Will need more clarity, but the base addressing scheme is based on the Bluetooth LE spec which displaces the offsets in the upper bits of the address. It was a surprise for me when I first learned it, but there it is.
Let me re-phrase this, a BLE would have UUID. From the code that you have there, is specifically Texas Instruments based, which uses base address.
- (instancetype)initWithPeripheral:(CBPeripheral *)peripheral
central:(YMSCBCentralManager *)owner
baseHi:(int64_t)hi
baseLo:(int64_t)lo;
Notice for example, the parameters hi and lo, what is specified here? When CoreBluetooth returns a CBPeripheral, we have the UUID, but...How do you obtain a baseHi
and baseLo
from that UUID?
For non based TI BLE devices, there's a lot of methods that specifies base address, so how would this be handled? Base Address == UUID?
Understood. The API intends to treat the 128-bit UUID as a number, so separates it into two 64-bit numbers, since there is no 128-bit type. baseHi
refers to the upper 64 bits, whereas baseLo
refers to the lower 64 bits.
Maybe this needs to be clarified in the documentation, that the UUID needs to be split up to two 64bits as someone would be under the impression that this will work out of the box.
I'll consider it but I've already had some mention of it in the documentation:
Hi,
Can you please show me how to split an 128bit UUID into two 64bits in order to use them as baseHi and baseLo?
@tudorached: you would split the UUID in half, with the right half used as baseHi
and the left half used as baseLo
.
For example, given the UUID 38C5AB2F-065A-4A02-BA36-4F29EE21228E
, it would set so
baseHi = 0x38C5AB2F065A4A02
baseLo = 0xBA364F29EE21228E
Hi,
Is this really needed, outside of TI boards. It looks confusing if there's a non-TI board that is running but has no base address.
Can you clarify this please?
Regards,