BondingFailure

The reason why bonding of a simulated peripheral failed.

The client is told the matching reason, and the phone terminates the link a few seconds later. A peripheral that terminates the link itself after a failed bonding can be simulated by calling PeripheralSpec.simulateDisconnection().

Note: Most phones report all the failures, except REJECTED on some, with the same reason (the library reports it as AuthenticationFailed), and the exact reason differs between Android versions. Use REJECTED to emulate a real refusal of the peripheral. The other failures allow testing how the app reacts to the other reasons, which may be reported by phones in the future.

CANCELLED and WRONG_PIN only make sense for pairing that requires user interaction. AUTH_FAILED is the same as WRONG_PIN, but reads better when the simulated peripheral does not use a PIN.

Entries

Link copied to clipboard

The peripheral refused to pair, e.g. it does not support bonding. This is the default.

Link copied to clipboard

The user cancelled the pairing, e.g. by tapping Cancel on the pairing dialog.

Link copied to clipboard

The user entered a wrong PIN. It is reported in the same way as AUTH_FAILED.

Link copied to clipboard

The authentication failed, e.g. the keys did not match. It is reported in the same way as WRONG_PIN, and can be used when the simulated peripheral does not use a PIN.

Link copied to clipboard

The pairing was not completed in time, e.g. the user ignored the pairing dialog.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.