diff --git a/ble_issue_tracker.md b/ble_issue_tracker.md deleted file mode 100644 index 21143df..0000000 --- a/ble_issue_tracker.md +++ /dev/null @@ -1,62 +0,0 @@ -# micro:bit BLE - Issue Tracker ----------- - -Profile Design --------------- - -### OPEN: - - -### CLOSED: - -D1. Lose the System LED State characteristic since it cannot be controlled from the BLE MCU.DONE. - -D2. Lose the Scrolling State characteristic – complexity and memory constraints. DONE. - -D3. Simplify the IO Pin Service, possible to expose the edge connector pins only. Possibly drop it to save memory and use the event service to transport pin values in either direction. Needs further thought. - -* Update: Removed all pin characteristics except for pin 0, pin 1 and pin 2. - -D4. Generic Access Service: Peripheral Privacy Flag is optional and I don’t think we need it. Ditto Reconnection Address, ditto Peripheral Preferred Connection Parameters --> Removed optional characteristics Peripheral Privacy Flag, Reconnection Address and Peripheral Preferred Connection Parameters from Generic Access Service. - -D5. Generic Attribute Service: profile design doc/report doesn’t show it and it’s mandatory (issue with Bluetooth Developer Studio). - -D6. Device Information Service: All characteristics are optional. Which ones do we really want/need? Save a little memory --> Removed PnP ID, IEEE 11073-20601 Regulatory Certification Data List, System ID and Software Revision String characteristics. - -D7. Why does LED Matrix State support “Write Without Response”? I think this should be plain “Write” so that no further writes are made until there’s been an ACK back from the previous one. Changed. - -D8. MicroBit Requirements supports Write. This is (ironically and puntastically) wrong. Client should not be able to modify the requirements the MicroBit has. Changed. - -D9. DFU services uses a different base UUID to the other custom services. Is this deliberate? - -D10. Characteristics in the DFU service use a different base UUID to the parent service. Is this deliberate? - -D11. What are the data types for DFU Control and DFU Flash Code? Assumed uint8 and array of uint8. - -D12. Microbit DFU service not in the profile design. Added. Needs descriptions and data types confirming. - - - -Profile Testing ---------------- - -### OPEN: -T1. Client Event characteristic should have the WRITE property and currently does not. - -T2. MicroBit Event characteristic should have the READ property and currently does not. - -T3. MicroBit Event characteristic should have the NOTIFY property and currently does not. - -T4. MicroBit Requirements characteristic is missing from the Event Service - -T5. Client Requirements characteristic is missing from the Event Service - -T6. Device Name in advertising packets includes the flash code so anyone could pair to it. Should be removed. - -T7. Generic Access Service: Device Name and Appearance are mandatory and so need values - -T8. Review advertising parameters: Advertising frequency seems quite low. This will make the discovery process slower and overall, both the pairing and FOTA processes a little slower. Are all three advertising channels in use or not? Thinking of a class room or event it would be best to use all three. - -T9. Consider using directed advertising and white listing so that only the paired peer device can (re)connect to the micro:bit. I believe we are currently performing undirected advertising.... basically broadcasting. Directed advertising will address ADV packets to the paired peer device only. As things stand it seems to me that if some other person in the classroom just decides to connect to a micro:bit that is not theirs, they’ve effectively blocked all other use of the device.... a simple DOS attack. - -### CLOSED: diff --git a/docs/BBC Micro Bit Bluetooth Profile V1.6.docx b/docs/BBC Micro Bit Bluetooth Profile V1.6.docx index 0739c90..54015f5 100644 Binary files a/docs/BBC Micro Bit Bluetooth Profile V1.6.docx and b/docs/BBC Micro Bit Bluetooth Profile V1.6.docx differ diff --git a/docs/Report 1/BBC microbit.html b/docs/Report 1/BBC microbit.html index 7e10ee8..2b8f34a 100644 --- a/docs/Report 1/BBC microbit.html +++ b/docs/Report 1/BBC microbit.html @@ -1,6 +1,6 @@ -
Default 'out of the box' profile for the BBC Micro Bit
Version 1.6 - 17th October 2015 +Removed the Battery Service. No way to establish battery levels on the micro:bit +Added a simple Temperature Service to exploit temperature sensors in micro:bit processors with Temperature and Temperature Period characteristics. +Accelerometer and Magnetometer period characteristics now have uint16 fields instead of uint8 which required scaling up by multipling by 10. +Accelerometer Data and Magnetometer Data characteristics now use signed 16 bit integer fields for each of their X, Y and Z parts. +Accelerometer Data and Magnetometer Data characteristics now use signed 16 bit integer fields for each of their X, Y and Z parts. +New characteristic Magnetometer Heading added to the Magnetometer Service. Provides current heading in degrees. +Removed IO Parallel Port characteristic due to complexity and memory considerations. +Added Generic Attribute Service (previously absent in the repository) +Changed the LED Matrix State characteristic field so that we now have one octet per row of LEDs for ease of use. + +Version 1.5 - 10th September 2015 +Button State 2 characteristic given new, distinct UUID of E95DDA91-251D-470A-A062-FA1922DFA9A8 +Removed the System LED State characteristic from the LED Service since it cannot be controlled from the BLE MCU. +Removed the Scrolling State characteristic from the LED Service due to complexity and memory constraints. +Changed LED Matrix State use of “Write Without Response” to “Write” so that no further writes can be made until there’s been an ACK back from the previous one. +Removed Write property from MicroBit Requirements characteristic.
Generic Access
Generic Access
0000180000001000800000805F9B34FB
00002A00-0000-1000-8000-00805F9B34FB : Device Name
Device Name : 00002A0000001000800000805F9B34FB
00002A01-0000-1000-8000-00805F9B34FB : Appearance
Appearance : 00002A0100001000800000805F9B34FB
Peripheral Preferred Connection Parameters : 00002A0400001000800000805F9B34FB
Generic Attribute
Generic Attribute
0000180100001000800000805F9B34FB
2A05 : Service Changed
Service Changed : 2A05
Device Information
Device Information
0000180A00001000800000805F9B34FB
00002A29-0000-1000-8000-00805F9B34FB : Manufacturer Name String
Manufacturer Name String : 00002A2900001000800000805F9B34FB
00002A24-0000-1000-8000-00805F9B34FB : Model Number String
Model Number String : 00002A2400001000800000805F9B34FB
00002A25-0000-1000-8000-00805F9B34FB : Serial Number String
Serial Number String : 00002A2500001000800000805F9B34FB
00002A27-0000-1000-8000-00805F9B34FB : Hardware Revision String
Hardware Revision String : 00002A2700001000800000805F9B34FB
00002A26-0000-1000-8000-00805F9B34FB : Firmware Revision String
Firmware Revision String : 00002A2600001000800000805F9B34FB
Software Revision String : 00002A2800001000800000805F9B34FB
ACCELEROMETER SERVICE
ACCELEROMETER SERVICE
E95D0753251D470AA062FA1922DFA9A8
E95DCA4B-251D-470A-A062-FA1922DFA9A8 : Accelerometer Data
Accelerometer Data : E95DCA4B251D470AA062FA1922DFA9A8
E95DFB24-251D-470A-A062-FA1922DFA9A8 : Accelerometer Period
Accelerometer Period : E95DFB24251D470AA062FA1922DFA9A8
MAGNETOMETER SERVICE
MAGNETOMETER SERVICE
E95DF2D8251D470AA062FA1922DFA9A8
E95DFB11-251D-470A-A062-FA1922DFA9A8 : Magnetometer Data
Magnetometer Data : E95DFB11251D470AA062FA1922DFA9A8
E95D386C-251D-470A-A062-FA1922DFA9A8 : Magnetometer Period
Magnetometer Period : E95D386C251D470AA062FA1922DFA9A8
E95D9715-251D-470A-A062-FA1922DFA9A8 : Magnetometer Bearing
Magnetometer Bearing : E95D9715251D470AA062FA1922DFA9A8
Button Service
Button Service
E95D9882251D470AA062FA1922DFA9A8
E95DDA90-251D-470A-A062-FA1922DFA9A8 : Button 1 State
Button 1 State : E95DDA90251D470AA062FA1922DFA9A8
E95DDA91-251D-470A-A062-FA1922DFA9A8 : Button 2 State
Button 2 State : E95DDA91251D470AA062FA1922DFA9A8
IO PIN SERVICE
IO PIN SERVICE
E95D127B251D470AA062FA1922DFA9A8
E95D8D00-251D-470A-A062-FA1922DFA9A8 : Pin Data
Pin Data : E95D8D00251D470AA062FA1922DFA9A8
E95D5899-251D-470A-A062-FA1922DFA9A8 : Pin AD Configuration
Pin AD Configuration : E95D5899251D470AA062FA1922DFA9A8
E95DB9FE-251D-470A-A062-FA1922DFA9A8 : Pin IO Configuration
Pin IO Configuration : E95DB9FE251D470AA062FA1922DFA9A8
LED SERVICE
LED SERVICE
E95DD91D251D470AA062FA1922DFA9A8
E95D7B77-251D-470A-A062-FA1922DFA9A8 : LED Matrix State
LED Matrix State : E95D7B77251D470AA062FA1922DFA9A8
E95D93EE-251D-470A-A062-FA1922DFA9A8 : LED Text
LED Text : E95D93EE251D470AA062FA1922DFA9A8
E95D0D2D-251D-470A-A062-FA1922DFA9A8 : Scrolling Delay
Scrolling Delay : E95D0D2D251D470AA062FA1922DFA9A8
EVENT SERVICE
EVENT SERVICE
E95D93AF251D470AA062FA1922DFA9A8
E95DB84C-251D-470A-A062-FA1922DFA9A8 : MicroBit Requirements
MicroBit Requirements : E95DB84C251D470AA062FA1922DFA9A8
E95D9775-251D-470A-A062-FA1922DFA9A8 : MicroBit Event
MicroBit Event : E95D9775251D470AA062FA1922DFA9A8
E95D23C4-251D-470A-A062-FA1922DFA9A8 : Client Requirements
Client Requirements : E95D23C4251D470AA062FA1922DFA9A8
E95D5404-251D-470A-A062-FA1922DFA9A8 : Client Event
Client Event : E95D5404251D470AA062FA1922DFA9A8
DFU CONTROL SERVICE
DFU CONTROL SERVICE
E95D93B0251D470AA062FA1922DFA9A8
E95D93B1-251D-470A-A062-FA1922DFA9A8 : DFU Control
DFU Control : E95D93B1251D470AA062FA1922DFA9A8
E95D93B2-251D-470A-A062-FA1922DFA9A8 : DFU Flash Code
DFU Flash Code : E95D93B2251D470AA062FA1922DFA9A8
TEMPERATURE SERVICE
TEMPERATURE SERVICE
E95D6100251D470AA062FA1922DFA9A8
E95D8A38-251D-470A-A062-FA1922DFA9A8 : Temperature
Temperature : E95D9250251D470AA062FA1922DFA9A8
Temperature Period : E95D1B25251D470AA062FA1922DFA9A8
Default 'out of the box' profile for the BBC Micro Bit
Version 1.6 - 17th October 2015 +Removed the Battery Service. No way to establish battery levels on the micro:bit +Added a simple Temperature Service to exploit temperature sensors in micro:bit processors with Temperature and Temperature Period characteristics. +Accelerometer and Magnetometer period characteristics now have uint16 fields instead of uint8 which required scaling up by multipling by 10. +Accelerometer Data and Magnetometer Data characteristics now use signed 16 bit integer fields for each of their X, Y and Z parts. +Accelerometer Data and Magnetometer Data characteristics now use signed 16 bit integer fields for each of their X, Y and Z parts. +New characteristic Magnetometer Heading added to the Magnetometer Service. Provides current heading in degrees. +Removed IO Parallel Port characteristic due to complexity and memory considerations. +Added Generic Attribute Service (previously absent in the repository) +Changed the LED Matrix State characteristic field so that we now have one octet per row of LEDs for ease of use. + +Version 1.5 - 10th September 2015 +Button State 2 characteristic given new, distinct UUID of E95DDA91-251D-470A-A062-FA1922DFA9A8 +Removed the System LED State characteristic from the LED Service since it cannot be controlled from the BLE MCU. +Removed the Scrolling State characteristic from the LED Service due to complexity and memory constraints. +Changed LED Matrix State use of “Write Without Response” to “Write” so that no further writes can be made until there’s been an ACK back from the previous one. +Removed Write property from MicroBit Requirements characteristic.
The generic_access service contains generic information about the device. All available Characteristics are readonly.
1. Name utf8s |
The external appearance of this device. The values are composed of a category (10-bits) and sub-categories (6-bits).
1. Category 16bit |
Peripheral Preferred Connection Parameters
1. Start of Affected Attribute Handle Range uint16 |
2. End of Affected Attribute Handle Range uint16 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
The Device Information Service exposes manufacturer and/or vendor information about a device. +
This service exposes manufacturer information about a device. +The Device Information Service is instantiated as a Primary Service. +Only one instance of the Device Information Service is exposed on a device. +
The value of this characteristic is a UTF-8 string representing the name of the manufacturer of the device.
1. Manufacturer Name utf8s |
The value of this characteristic is a UTF-8 string representing the model number assigned by the device vendor.
1. Model Number utf8s |
The value of this characteristic is a variable-length UTF-8 string representing the serial number for a particular instance of the device.
1. Serial Number utf8s |
The value of this characteristic is a UTF-8 string representing the hardware revision for the hardware within the device.
1. Hardware Revision utf8s |
The value of this characteristic is a UTF-8 string representing the firmware revision for the firmware within the device.
1. Firmware Revision utf8s |
Software Revision String
The value of this characteristic is a UTF-8 string representing the software revision for the software within the device. +
Exposes accelerometer data. An accelerometer is an electromechanical device that will measure acceleration forces. +These forces may be static, like the constant force of gravity pulling at your feet, or they could be dynamic - caused by moving or vibrating the accelerometer. + +Value contains fields which represent 3 seperate accelerometer measurements for X, Y and Z axes as 3 unsigned 16 bit values in that order and in +little endian format. + +Data can be read on demand or notified periodically.
Contains accelerometer measurements for X, Y and Z axes as 3 signed 16 bit values in that order and in little endian format.
1. Accelerometer_X sint16 |
2. Accelerometer_Y sint16 |
3. Accelerometer_Z sint16 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
Determines the frequency with which accelerometer data is reported in milliseconds.
1. Accelerometer_Period uint16 |
Exposes magnetometer data. A magnetometer measures a magnetic field such as the earth's magnetic field in 3 axes.
Contains magnetometer measurements for X, Y and Z axes as 3 signed 16 bit values in that order and in little endian format. +Data can be read on demand or notified periodically.
1. Magnetometer_X sint16 |
2. Magnetometer_Y sint16 |
3. Magnetometer_Z sint16 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
Determines the frequency with which magnetometer data is reported in milliseconds.
1. Magnetometer_Period uint16 |
Compass bearing in degrees from North.
1. bearing value uint16 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
Exposes the two Micro Bit buttons and allows 'commands' associated with button state changes to be associated with button states and notified to a connected client.
State of Button A may be read on demand by a connected client or the client may subscribe to notifications of state change. +3 button states are defined and represented by a simple numeric enumeration: 0 = not pressed, 1 = pressed, 2 = long press.
1. Button_State_Value uint8 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
State of Button B may be read on demand by a connected client or the client may subscribe to notifications of state change. +3 button states are defined and represented by a simple numeric enumeration: 0 = not pressed, 1 = pressed, 2 = long press.
1. Button_State_Value uint8 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
Provides read/write access to I/O pins, individually or collectively. Allows configuration of each pin for input/output and analogue/digital use.
Contains data relating to zero or more pins. Structured as a variable length array of up to 19 Pin Number / Value pairs. + +Pin Number and Value are each uint8 fields. + +Note however that the micro:bit has a 10 bit ADC and so values are compressed to 8 bits with a loss of resolution. + +OPERATIONS: + +WRITE: Clients may write values to one or more pins in a single GATT write operation. +A pin to which a value is to be written must have been configured for output using the Pin IO Configuration characteristic. +Any attempt to write to a pin which is configured for input will be ignored. + +NOTIFY: Notifications will deliver Pin Number / Value pairs for those pins defined as input pins by the Pin IO Configuration characteristic +and whose value when read differs from the last read of the pin. + +READ: A client reading this characteristic will receive Pin Number / Value pairs for all those pins defined as input pins by the Pin IO Configuration characteristic.
1. IO_Pin_Data uint8[] |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
A bit mask which allows each pin to be configured for analogue or digital use.
1. Pin_AD_Config_Value uint24 |
A bit mask which allows each pin to be configured for input or output use. +Bit n corresponds to pin n where 0 LESS THAN OR EQUAL TO n LESS THAN 19. A value of 0 means configured for output and 1 means configured for input.
1. Pin_IO_Config_Value uint24 |
Provides access to and control of LED state. Allows the state (ON or OFF) of all 25 LEDs to be set in a single write operation. +Allows short text strings to be sent by a client for display on the LED matrix and scrolled across at a speed controlled by the Scrolling Delay characteristic.
Allows the state of any|all LEDs in the 5x5 grid to be set to on or off with a single GATT operation. +Consists of an array of 5 x utf8 octets, each representing one row of 5 LEDs. +Octet 0 represents the first row of LEDs i.e. the top row when the micro:bit is viewed with the edge connector at the bottom and USB connector at the top. +Octet 1 represents the second row and so on. +In each octet, bit 4 corresponds to the first LED in the row, bit 3 the second and so on. +Bit values represent the state of the related LED: off (0) or on (1). + +So we have: + +Octet 0, LED Row 1: bit4 bit3 bit2 bit1 bit0 +Octet 1, LED Row 2: bit4 bit3 bit2 bit1 bit0 +Octet 2, LED Row 3: bit4 bit3 bit2 bit1 bit0 +Octet 3, LED Row 4: bit4 bit3 bit2 bit1 bit0 +Octet 4, LED Row 5: bit4 bit3 bit2 bit1 bit0 +
1. LED_Matrix_State uint32 |
A short UTF-8 string to be shown on the LED display.
1. LED_Text_Value utf8s |
Specifies a millisecond delay to wait for in between showing each character on the display.
1. Scrolling_Delay_Value uint16 |
A generic, bi-directional event communication service. + +The Event Service allows events or commands to be notified to the micro:bit by a connected client and it allows micro:bit to notify the connected client +of events or commands originating from with the micro:bit. The micro:bit can inform the client of the types of event it is interested in being informed +about (e.g. an incoming call) and the client can inform the micro:bit of types of event it wants to be notified about. + +The term “event” will be used here for both event and command types of data. + +Events may have an associated value. + +Note that specific event ID values including any special values such as those which may represent wild cards are not defined here. +The micro:bit run time documentation should be consulted for this information. + +Multiple events of different types may be notified to the client or micro:bit at the same time. +Event data is encoded as an array of structs each encoding an event of a given type together with an associated value. +Event Type and Event Value are both defined as uint16 and therefore the length of this array will always be a multiple of 4. + +struct event { + uint16 event_type; + uint16 event_value; +};
A variable length list of event data structures which indicates the types of client event, potentially with a specific value which the micro:bit wishes +to be informed of when they occur. The client should read this characteristic when it first connects to the micro:bit. It may also subscribe to notifications +to that it can be informed if the value of this characteristic is changed by the micro:bit firmware.
1. microbit_reqs_value uint8[] |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
Contains one or more event structures which should be notified to the client. It supports notifications and as such the client should subscribe to +notifications from this characteristic.
1. Event_Type_And_Value uint8[] |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
a variable length list of event data structures which indicates the types of micro:bit event, potentially with a specific value which the client wishes +to be informed of when they occur. The client should write to this characteristic when it first connects to the micro:bit.
1. Client_Requirements_Value uint8[] |
a writable characteristic which the client may write one or more event structures to, to inform the micro:bit of events which have occurred on the client. +These should be of types indicated in the micro:bit Requirements characteristic bit mask.
1. Event_Types_And_Values uint8[] |
Allows clients to initiate the micro:bit pairing and over the air firmware update procedures.
Writing 0x01 initiates rebooting the micro:bit into the Nordic Semiconductor bootloader if the DFU Flash Code characteristic has been written +to with the correct secret key. + +Writing 0x02 to this characteristic means "request flash code".
1. dfu_control uint8 |
Allows a client to indicate that it "knows" the flash code produced when pairing. + +Notifications are used to deliver the flash code to a client during the initial pairing process.
1. dfu_flash_code uint32 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
Ambient temperature derived from several internal temperature sensors on the micro:bit
Signed integer 8 bit value in degrees celsius.
1. temperature value sint8 |
1. Client Characteristic Configuration : 2902 |
Temperature Period
Determines the frequency with which temperature data is updated in milliseconds.
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
Default 'out of the box' profile for the BBC Micro Bit
Version 1.6 - 17th October 2015 +Removed the Battery Service. No way to establish battery levels on the micro:bit +Added a simple Temperature Service to exploit temperature sensors in micro:bit processors with Temperature and Temperature Period characteristics. +Accelerometer and Magnetometer period characteristics now have uint16 fields instead of uint8 which required scaling up by multipling by 10. +Accelerometer Data and Magnetometer Data characteristics now use signed 16 bit integer fields for each of their X, Y and Z parts. +Accelerometer Data and Magnetometer Data characteristics now use signed 16 bit integer fields for each of their X, Y and Z parts. +New characteristic Magnetometer Heading added to the Magnetometer Service. Provides current heading in degrees. +Removed IO Parallel Port characteristic due to complexity and memory considerations. +Added Generic Attribute Service (previously absent in the repository) +Changed the LED Matrix State characteristic field so that we now have one octet per row of LEDs for ease of use. + +Version 1.5 - 10th September 2015 +Button State 2 characteristic given new, distinct UUID of E95DDA91-251D-470A-A062-FA1922DFA9A8 +Removed the System LED State characteristic from the LED Service since it cannot be controlled from the BLE MCU. +Removed the Scrolling State characteristic from the LED Service due to complexity and memory constraints. +Changed LED Matrix State use of “Write Without Response” to “Write” so that no further writes can be made until there’s been an ACK back from the previous one. +Removed Write property from MicroBit Requirements characteristic.
The generic_access service contains generic information about the device. All available Characteristics are readonly.
1. Name utf8s |
1. Name : utf8s |
The external appearance of this device. The values are composed of a category (10-bits) and sub-categories (6-bits).
1. Category 16bit |
1. Category : 16bit |
Peripheral Preferred Connection Parameters
1. Minimum Connection Interval : uint16 |
2. Maximum Connection Interval : uint16 |
3. Slave Latency : uint16 |
4. Connection Supervision Timeout Multiplier : uint16 |
1. Start of Affected Attribute Handle Range uint16 |
2. End of Affected Attribute Handle Range uint16 |
1. Start of Affected Attribute Handle Range : uint16 |
2. End of Affected Attribute Handle Range : uint16 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
The Device Information Service exposes manufacturer and/or vendor information about a device. +
This service exposes manufacturer information about a device. +The Device Information Service is instantiated as a Primary Service. +Only one instance of the Device Information Service is exposed on a device. +
The value of this characteristic is a UTF-8 string representing the name of the manufacturer of the device.
1. Manufacturer Name utf8s |
1. Manufacturer Name : utf8s |
The value of this characteristic is a UTF-8 string representing the model number assigned by the device vendor.
1. Model Number utf8s |
1. Model Number : utf8s |
The value of this characteristic is a variable-length UTF-8 string representing the serial number for a particular instance of the device.
1. Serial Number utf8s |
1. Serial Number : utf8s |
The value of this characteristic is a UTF-8 string representing the hardware revision for the hardware within the device.
1. Hardware Revision utf8s |
1. Hardware Revision : utf8s |
The value of this characteristic is a UTF-8 string representing the firmware revision for the firmware within the device.
1. Firmware Revision utf8s |
1. Firmware Revision : utf8s |
Software Revision String
The value of this characteristic is a UTF-8 string representing the software revision for the software within the device. +
1. Software Revision : utf8s |
Exposes accelerometer data. An accelerometer is an electromechanical device that will measure acceleration forces. +These forces may be static, like the constant force of gravity pulling at your feet, or they could be dynamic - caused by moving or vibrating the accelerometer. + +Value contains fields which represent 3 seperate accelerometer measurements for X, Y and Z axes as 3 unsigned 16 bit values in that order and in +little endian format. + +Data can be read on demand or notified periodically.
Contains accelerometer measurements for X, Y and Z axes as 3 signed 16 bit values in that order and in little endian format.
1. Accelerometer_X sint16 |
2. Accelerometer_Y sint16 |
3. Accelerometer_Z sint16 |
1. Accelerometer_X : sint16 |
2. Accelerometer_Y : sint16 |
3. Accelerometer_Z : sint16 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
Determines the frequency with which accelerometer data is reported in milliseconds.
1. Accelerometer_Period uint16 |
1. Accelerometer_Period : uint16 |
Exposes magnetometer data. A magnetometer measures a magnetic field such as the earth's magnetic field in 3 axes.
Contains magnetometer measurements for X, Y and Z axes as 3 signed 16 bit values in that order and in little endian format. +Data can be read on demand or notified periodically.
1. Magnetometer_X sint16 |
2. Magnetometer_Y sint16 |
3. Magnetometer_Z sint16 |
1. Magnetometer_X : sint16 |
2. Magnetometer_Y : sint16 |
3. Magnetometer_Z : sint16 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
Determines the frequency with which magnetometer data is reported in milliseconds.
1. Magnetometer_Period uint16 |
1. Magnetometer_Period : uint16 |
Compass bearing in degrees from North.
1. bearing value uint16 |
1. bearing value : uint16 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
Exposes the two Micro Bit buttons and allows 'commands' associated with button state changes to be associated with button states and notified to a connected client.
State of Button A may be read on demand by a connected client or the client may subscribe to notifications of state change. +3 button states are defined and represented by a simple numeric enumeration: 0 = not pressed, 1 = pressed, 2 = long press.
1. Button_State_Value uint8 |
1. Button_State_Value : uint8 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
State of Button B may be read on demand by a connected client or the client may subscribe to notifications of state change. +3 button states are defined and represented by a simple numeric enumeration: 0 = not pressed, 1 = pressed, 2 = long press.
1. Button_State_Value uint8 |
1. Button_State_Value : uint8 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
Provides read/write access to I/O pins, individually or collectively. Allows configuration of each pin for input/output and analogue/digital use.
Contains data relating to zero or more pins. Structured as a variable length array of up to 19 Pin Number / Value pairs. + +Pin Number and Value are each uint8 fields. + +Note however that the micro:bit has a 10 bit ADC and so values are compressed to 8 bits with a loss of resolution. + +OPERATIONS: + +WRITE: Clients may write values to one or more pins in a single GATT write operation. +A pin to which a value is to be written must have been configured for output using the Pin IO Configuration characteristic. +Any attempt to write to a pin which is configured for input will be ignored. + +NOTIFY: Notifications will deliver Pin Number / Value pairs for those pins defined as input pins by the Pin IO Configuration characteristic +and whose value when read differs from the last read of the pin. + +READ: A client reading this characteristic will receive Pin Number / Value pairs for all those pins defined as input pins by the Pin IO Configuration characteristic.
1. IO_Pin_Data uint8[] |
1. IO_Pin_Data : uint8[] |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
A bit mask which allows each pin to be configured for analogue or digital use.
1. Pin_AD_Config_Value uint24 |
1. Pin_AD_Config_Value : uint24 |
A bit mask which allows each pin to be configured for input or output use. +Bit n corresponds to pin n where 0 LESS THAN OR EQUAL TO n LESS THAN 19. A value of 0 means configured for output and 1 means configured for input.
1. Pin_IO_Config_Value uint24 |
1. Pin_IO_Config_Value : uint24 |
Provides access to and control of LED state. Allows the state (ON or OFF) of all 25 LEDs to be set in a single write operation. +Allows short text strings to be sent by a client for display on the LED matrix and scrolled across at a speed controlled by the Scrolling Delay characteristic.
Allows the state of any|all LEDs in the 5x5 grid to be set to on or off with a single GATT operation. +Consists of an array of 5 x utf8 octets, each representing one row of 5 LEDs. +Octet 0 represents the first row of LEDs i.e. the top row when the micro:bit is viewed with the edge connector at the bottom and USB connector at the top. +Octet 1 represents the second row and so on. +In each octet, bit 4 corresponds to the first LED in the row, bit 3 the second and so on. +Bit values represent the state of the related LED: off (0) or on (1). + +So we have: + +Octet 0, LED Row 1: bit4 bit3 bit2 bit1 bit0 +Octet 1, LED Row 2: bit4 bit3 bit2 bit1 bit0 +Octet 2, LED Row 3: bit4 bit3 bit2 bit1 bit0 +Octet 3, LED Row 4: bit4 bit3 bit2 bit1 bit0 +Octet 4, LED Row 5: bit4 bit3 bit2 bit1 bit0 +
1. LED_Matrix_State uint32 |
1. LED_Matrix_State : uint8[] |
A short UTF-8 string to be shown on the LED display.
1. LED_Text_Value utf8s |
1. LED_Text_Value : utf8s |
Specifies a millisecond delay to wait for in between showing each character on the display.
1. Scrolling_Delay_Value uint16 |
1. Scrolling_Delay_Value : uint16 |
A generic, bi-directional event communication service. + +The Event Service allows events or commands to be notified to the micro:bit by a connected client and it allows micro:bit to notify the connected client +of events or commands originating from with the micro:bit. The micro:bit can inform the client of the types of event it is interested in being informed +about (e.g. an incoming call) and the client can inform the micro:bit of types of event it wants to be notified about. + +The term “event” will be used here for both event and command types of data. + +Events may have an associated value. + +Note that specific event ID values including any special values such as those which may represent wild cards are not defined here. +The micro:bit run time documentation should be consulted for this information. + +Multiple events of different types may be notified to the client or micro:bit at the same time. +Event data is encoded as an array of structs each encoding an event of a given type together with an associated value. +Event Type and Event Value are both defined as uint16 and therefore the length of this array will always be a multiple of 4. + +struct event { + uint16 event_type; + uint16 event_value; +};
A variable length list of event data structures which indicates the types of client event, potentially with a specific value which the micro:bit wishes +to be informed of when they occur. The client should read this characteristic when it first connects to the micro:bit. It may also subscribe to notifications +to that it can be informed if the value of this characteristic is changed by the micro:bit firmware.
1. microbit_reqs_value uint8[] |
1. microbit_reqs_value : uint8[] |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
Contains one or more event structures which should be notified to the client. It supports notifications and as such the client should subscribe to +notifications from this characteristic.
1. Event_Type_And_Value uint8[] |
1. Event_Type_And_Value : uint8[] |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
a variable length list of event data structures which indicates the types of micro:bit event, potentially with a specific value which the client wishes +to be informed of when they occur. The client should write to this characteristic when it first connects to the micro:bit.
1. Client_Requirements_Value uint8[] |
1. Client_Requirements_Value : uint8[] |
a writable characteristic which the client may write one or more event structures to, to inform the micro:bit of events which have occurred on the client. +These should be of types indicated in the micro:bit Requirements characteristic bit mask.
1. Event_Types_And_Values uint8[] |
1. Event_Types_And_Values : uint8[] |
Allows clients to initiate the micro:bit pairing and over the air firmware update procedures.
Writing 0x01 initiates rebooting the micro:bit into the Nordic Semiconductor bootloader if the DFU Flash Code characteristic has been written +to with the correct secret key. + +Writing 0x02 to this characteristic means "request flash code".
1. dfu_control uint8 |
1. dfu_control : uint8 |
Allows a client to indicate that it "knows" the flash code produced when pairing. + +Notifications are used to deliver the flash code to a client during the initial pairing process.
1. dfu_flash_code uint32 |
1. dfu_flash_code : uint32 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |
1. Client Characteristic Configuration : 2902 |
Ambient temperature derived from several internal temperature sensors on the micro:bit
Signed integer 8 bit value in degrees celsius.
1. temperature value sint8 |
1. temperature value : sint8 |
1. Client Characteristic Configuration : 2902 |
Temperature Period
Determines the frequency with which temperature data is updated in milliseconds.
1. temperature period value : uint16 |
1. Client Characteristic Configuration 2902 org.bluetooth.descriptor.gatt.client_characteristic_configuration |