-
Hello, How can I connect to a device which is not advertising? I saw that peripheral can be created via identifier, but is it possible to obtain identifier from a common code? I know what iOS does not expose MAC address of the devices, so do I need to save both UUID from iOS and MAC from Android to get my app working on both platforms to connect to same device? Any clues and tactics are welcome, thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
It is my understanding that you cannot connect to a device unless it is advertising (even if you have its identifier) — at least this has been my experience on Android, not certain about the other platforms. Every time I've tried to connect to a device that isn't advertising, on Android I get a GATT 133 error. So, at least on Android, having the identifier simply means you don't need to scan, but the device will still need to be advertising.
Identifier support was added in 1.16.0. You can retrieve the identifier via the As for creating a Common public expect fun CoroutineScope.peripheralFromIdentifier(
identifier: Identifier,
builderAction: PeripheralBuilderAction = {},
) Android public actual fun CoroutineScope.peripheralFromIdentifier(
identifier: Identifier,
builderAction: PeripheralBuilderAction,
) = peripheral(identifier, builderAction) Apple public actual fun CoroutineScope.peripheralFromIdentifier(
identifier: Identifier,
builderAction: PeripheralBuilderAction,
) = peripheral(identifier, builderAction) Once #286 has been resolved, then we'll be able to provide similar functions as shown above to make creating peripherals from identifiers available from "common" code. |
Beta Was this translation helpful? Give feedback.
It is my understanding that you cannot connect to a device unless it is advertising (even if you have its identifier) — at least this has been my experience on Android, not certain about the other platforms. Every time I've tried to connect to a device that isn't advertising, on Android I get a GATT 133 error.
So, at least on Android, having the identifier simply means you don't need to scan, but the device will still need to be advertising.
Identifier support was added in 1.16.0.
You can retrieve the identifier via the
…