generic_access
GenericAccessService #
This class contains the functions to access the information provided by the Bluetooth generic access service to read out
Source code in src/kaspersmicrobit/services/generic_access.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
is_available #
is_available() -> bool
Checks whether the generic access Bluetooth service is found on the connected micro:bit.
Returns:
-
bool
–true if the generic access service was found, false if not.
Source code in src/kaspersmicrobit/services/generic_access.py
19 20 21 22 23 24 25 26 |
|
read_device_name #
read_device_name() -> str
Reads the name of the micro:bit.
Returns:
-
str
–the name of the micro:bit
Raises:
-
BluetoothServiceNotFound
–When the generic access service is not active on the micro:bit
-
BluetoothCharacteristicNotFound
–When the generic access service is running but there was no way to read the device name (normally not present)
Source code in src/kaspersmicrobit/services/generic_access.py
28 29 30 31 32 33 34 35 36 37 38 39 40 |
|