identifier

abstract val identifier: Identifier

Platform specific identifier for the remote peripheral. On some platforms, this can be used to "restore" a previously known peripheral for reconnection.

On Android, this is a MAC address represented as a String. A Peripheral can be created from this MAC address using the CoroutineScope.peripheral(String, PeripheralBuilderAction) function unless the peripheral makes "use of a Bluetooth Smart feature known as 'LE Privacy'" (whereas the peripheral may provide a random MAC address, see Bluetooth Technology Protecting Your Privacy for more details)).

On Apple, this is a unique identifier represented as a Uuid. A Peripheral can be created from this identifier using the CoroutineScope.peripheral(Uuid, PeripheralBuilderAction) function. According to The Ultimate Guide to Apple’s Core Bluetooth:

This UUID isn't guaranteed to stay the same across scanning sessions and should not be 100% relied upon for peripheral re-identification. That said, we have observed it to be relatively stable and reliable over the long term assuming a major device settings reset has not occurred.

If CoroutineScope.peripheral(Uuid, PeripheralBuilderAction) throws a NoSuchElementException then a scan will be necessary to obtain an Advertisement for Peripheral creation.

On JavaScript, this is a unique identifier represented as a String. "Restoring" a peripheral from this identifier is not yet supported in Kable (as JavaScript requires user to explicitly enable this feature).