device_information
DeviceInformationService #
Source code in src/kaspersmicrobit/services/device_information.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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
is_available #
is_available() -> bool
Checks whether the device information Bluetooth service is found on the connected micro:bit.
Returns:
-
bool
–true if the device information service was found, false if not.
Source code in src/kaspersmicrobit/services/device_information.py
14 15 16 17 18 19 20 21 |
|
read_model_number #
read_model_number() -> str
Reads the model number of the micro:bit.
Returns:
-
str
–the model number of the micro:bit
Raises:
-
BluetoothServiceNotFound
–When the device information service is not active on the micro:bit
-
BluetoothCharacteristicNotFound
–When the device information button is active, but there was no way to read the model number (normally not present)
Source code in src/kaspersmicrobit/services/device_information.py
23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
read_serial_number #
read_serial_number() -> str
Reads the serial number of the micro:bit.
Returns:
-
str
–the serial number of the micro:bit
Raises:
-
BluetoothServiceNotFound
–When the device information service is not active on the micro:bit
-
BluetoothCharacteristicNotFound
–When the device information button is active, but there was no way to read the serial number (normally does not occur)
Source code in src/kaspersmicrobit/services/device_information.py
37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
read_firmware_revision #
read_firmware_revision() -> str
Reads the firmware version string from the micro:bit.
Returns:
-
str
–the firmware version string of the micro:bit
Raises:
-
BluetoothServiceNotFound
–When the device information service is not active on the micro:bit
-
BluetoothCharacteristicNotFound
–When the device information button is active, but there was no way to read the firmware version (normally not present)
Source code in src/kaspersmicrobit/services/device_information.py
51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
read_hardware_revision #
read_hardware_revision() -> str
Reads the hardware version string from the micro:bit.
Attention
Although reading the hardware revision is mentioned in the bluetooth profile of the micro:bit, I was not successful in doing this on the micro:bits I had available for testing
Returns:
-
str
–the hardware version string of the micro:bit
Raises:
-
BluetoothServiceNotFound
–When the device information service is not active on the micro:bit
-
BluetoothCharacteristicNotFound
–When the device information button is active, but there was no way to read the hardware version (normally not present)
Source code in src/kaspersmicrobit/services/device_information.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
read_manufacturer_name #
read_manufacturer_name() -> str
Reads the name of the manufacturer of the micro:bit.
Attention
Although reading the manufacturer's name is listed in the micro:bit's Bluetooth profile,I was not successful in doing this on the micro:bits I had available for testing
Returns:
-
str
–the name of the manufacturer of the micro:bit
Raises:
-
BluetoothServiceNotFound
–When the device information service is not active on the micro:bit
-
BluetoothCharacteristicNotFound
–When the device information button is active, but there was no way to read the manufacturer's name (normally not found)
Source code in src/kaspersmicrobit/services/device_information.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|