Categorygithub.com/BYEDUCK/bluetooth
modulepackage
0.7.1
Repository: https://github.com/byeduck/bluetooth.git
Documentation: pkg.go.dev

# README

Go Bluetooth

Go Bluetooth

PkgGoDev Linux macOS

Go Bluetooth is a cross-platform package for using Bluetooth Low Energy hardware from the Go programming language.

It works on typical operating systems such as Linux, macOS, and Windows.

It can also be used running "bare metal" on microcontrollers produced by Nordic Semiconductor by using TinyGo.

The Go Bluetooth package can be used to create both Bluetooth Low Energy Centrals as well as to create Bluetooth Low Energy Peripherals.

Bluetooth Low Energy Central

A typical Bluetooth Low Energy Central would be your laptop computer or mobile phone.

This example shows a central that scans for peripheral devices and then displays information about them as they are discovered:

package main

import (
	"tinygo.org/x/bluetooth"
)

var adapter = bluetooth.DefaultAdapter

func main() {
	// Enable BLE interface.
	must("enable BLE stack", adapter.Enable())

	// Start scanning.
	println("scanning...")
	err := adapter.Scan(func(adapter *bluetooth.Adapter, device bluetooth.ScanResult) {
		println("found device:", device.Address.String(), device.RSSI, device.LocalName())
	})
	must("start scan", err)
}

func must(action string, err error) {
	if err != nil {
		panic("failed to " + action + ": " + err.Error())
	}
}

Bluetooth Low Energy Peripheral

A typical Bluetooth Low Energy Peripheral would be a temperature sensor or heart rate sensor.

This example shows a peripheral that advertises itself as being available for connection:

package main

import (
	"time"

	"tinygo.org/x/bluetooth"
)

var adapter = bluetooth.DefaultAdapter

func main() {
  	// Enable BLE interface.
	must("enable BLE stack", adapter.Enable())

  	// Define the peripheral device info.
	adv := adapter.DefaultAdvertisement()
	must("config adv", adv.Configure(bluetooth.AdvertisementOptions{
		LocalName: "Go Bluetooth",
  	}))
  
  	// Start advertising
	must("start adv", adv.Start())

	println("advertising...")
	for {
		// Sleep forever.
		time.Sleep(time.Hour)
	}
}

func must(action string, err error) {
	if err != nil {
		panic("failed to " + action + ": " + err.Error())
	}
}

Current support

LinuxmacOSWindowsNordic Semi
API usedBlueZCoreBluetoothWinRTSoftDevice
Scanning:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
Connect to peripheral:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
Write peripheral characteristics:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
Receive notifications:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
Advertisement:heavy_check_mark::x::x::heavy_check_mark:
Local services:heavy_check_mark::x::x::heavy_check_mark:
Local characteristics:heavy_check_mark::x::x::heavy_check_mark:
Send notifications:heavy_check_mark::x::x::heavy_check_mark:

Linux

Go Bluetooth support for Linux uses BlueZ via the D-Bus interface thanks to the https://github.com/muka/go-bluetooth package. This should work with most distros that support BlueZ such as Ubuntu, Debian, Fedora, and Arch Linux, among others.

Linux can be used both as a BLE Central or as a BLE Peripheral.

Installation

You need to have a fairly recent version of BlueZ, for example v5.48 is the latest released version for Ubuntu/Debian.

sudo apt update
sudo apt install bluez

Once you have done this, you can obtain the Go Bluetooth package using Git:

git clone https://github.com/tinygo-org/bluetooth.git

Compiling

After you have followed the installation, you should be able to compile/run the "scanner" test program:

cd bluetooth
go run ./examples/scanner

macOS

Go Bluetooth support for macOS uses the CoreBluetooth libraries thanks to the https://github.com/tinygo-org/cbgo fork of the cbgo package.

As a result, it should work with most versions of macOS, although it will require compiling using whatever specific version of XCode is required by your version of the operating system.

The macOS support only can only act as a BLE Central at this time, with some additional development work needed for full functionality.

Installation

In order to compile Go Bluetooth code targeting macOS, you must do so on macOS itself. In other words, we do not currently have cross compiler support. You must also have XCode tools installed:

xcode-select --install

Once you have done this, you can obtain the Go Bluetooth package using Git:

git clone https://github.com/tinygo-org/bluetooth.git

Compiling

After you have followed the installation, you should be able to compile/run the "scanner" test program:

cd bluetooth
go run ./examples/scanner

Windows

Go Bluetooth support for Windows uses the WinRT Bluetooth interfaces by way of the https://github.com/saltosystems/winrt-go package.

The Windows support only can only act as a BLE Central at this time, with some additional development work needed for full functionality.

Installation

In order to compile Go Bluetooth code targeting Windows, you must have a GCC compiler installed.

On Windows, you can download and install mingw-w64 (https://github.com/mingw-w64/mingw-w64)

Once you have done this, you can obtain the Go Bluetooth package using Git:

git clone https://github.com/tinygo-org/bluetooth.git

Compiling

After you have followed the installation, you should be able to compile/run the "scanner" test program:

cd bluetooth
go run .\examples\scanner

Nordic Semiconductor

Go Bluetooth has bare metal support for several chips from Nordic Semiconductor that include a built-in Bluetooth Low Energy radio.

This support requires compiling your programs using TinyGo.

You must also use firmware provided by Nordic Semiconductor known as the "SoftDevice". The SoftDevice is a binary blob that implements the BLE stack. There are other (open source) BLE stacks, but the SoftDevices are pretty solid and have all the qualifications you might need. Other BLE stacks might be added in the future.

The Nordic Semiconductor SoftDevice can be used both as a BLE Central or as a BLE Peripheral, depending on which chip is being used. See the "Supported Chips" section below.

Installation

You must install TinyGo to be able to compile bare metal code using Go Bluetooth. Follow the instructions for your operating system at https://tinygo.org/getting-started/

Once you have installed TinyGo, you can install the Go Bluetooth package by running:

git clone https://github.com/tinygo-org/bluetooth.git

Check your desired target board for any additional installation requirements.

Adafruit "Bluefruit" boards

The line of "Bluefruit" boards created by Adafruit already have the SoftDevice firmware pre-loaded. This means you can use TinyGo and the Go Bluetooth package without any additional steps required. Supported Adafruit boards include:

After you have installed TinyGo and the Go Bluetooth package, you should be able to compile/run code for your device.

For example, this command can be used to compile and flash an Adafruit Circuit Playground Bluefruit board with the example we provide that turns it into a BLE server to control the built-in NeoPixel LEDs:

tinygo flash -target circuitplay-bluefruit ./examples/circuitplay

There are other boards with TinyGo support that also use the same UF2 bootloader with pre-loaded SoftDevice. They include:

BBC micro:bit

Version 1

The BBC micro:bit uses an nRF51 chip with a CMSIS-DAP interface.

You will need to install OpenOCD (http://openocd.org/) to flash the board.

First, flash the SoftDevice firmware by copying the .hex file to the device. For example (on Linux):

cd bluetooth
cp ./s110_nrf51_8.0.0/s110_nrf51_8.0.0_softdevice.hex /media/yourusername/MICROBIT/

Once you have copied the SoftDevice firmware to the BBC micro:bit, you can then flash your TinyGo program:

tinygo flash -target=microbit-s110v8 ./examples/heartrate

Version 2

The BBC micro:bit v2 uses an nRF52833 chip with a CMSIS-DAP interface.

Support for the v2 will be available soon.

Supported Chips

The following Nordic Semiconductor chips are currently supported:

  • nRF51822 with the S110 SoftDevice (version 8). This SoftDevice does not support all features (e.g. scanning).
  • nRF52832 with the S132 SoftDevice (version 6).
  • nRF52840 with the S140 SoftDevice (version 6 and 7).

Flashing the SoftDevice on Other Boards

To use a board that uses one of the above supported chips from Nordic Semiconductor, other then those already listed, you will probably need to install the SoftDevice firmware on the board yourself in order to use it with TinyGo and the Go Bluetooth package.

Flashing the SoftDevice can sometimes be tricky. If you have nrfjprog installed, you can erase the flash and flash the new BLE firmware using the following commands. Replace the path to the hex file with the correct SoftDevice, for example s132_nrf52_6.1.1/s132_nrf52_6.1.1_softdevice.hex for S132 version 6.

nrfjprog -f nrf52 --eraseall
nrfjprog -f nrf52 --program path/to/softdevice.hex

After that, don't reset the board but instead flash a new program to it. For example, you can flash the Heart Rate Sensor example using tinygo (modify the -target flag as needed for your board):

tinygo flash -target=pca10040-s132v6 ./examples/heartrate

Flashing will normally reset the board.

API stability

The API is not stable! Because many features are not yet implemented and some platforms (e.g. Windows and macOS) are not yet fully supported, it's hard to say what a good API will be. Therefore, if you want stability you should pick a particular git commit and use that. Go modules can be useful for this purpose.

Some things that will probably change:

  • Add options to the Scan method, for example to filter on UUID.
  • Extra options to the Enable function, to request particular features (such as the number of peripheral connections supported).

This package will probably remain unstable until the following has been implemented:

  • Scan filters. For example, to filter on service UUID.
  • Bonding and private addresses.
  • Full support for all features at least two desktop operating systems.
  • Maybe some Bluetooth Classic support, such as A2DP.

Contributing

Your contributions are welcome!

Please take a look at our CONTRIBUTING.md document for details.

Frequently Asked Questions

Q. Where can I get an introduction to Bluetooth Low Energy, GAP, GATT, etc.?

A. Please see this excellent article from our friends at Adafruit: https://learn.adafruit.com/introduction-to-bluetooth-low-energy

Q. What is a client and server in BLE?

A. Please see https://devzone.nordicsemi.com/f/nordic-q-a/71/what-is-a-client-and-server-in-ble

Q. Can a device be both a GATT client and GATT server?

A. Yes, but this is not currently supported by Go Bluetooth. Current support is either to act as a central in client mode, or as a peripheral in server mode.

License

This project is licensed under the BSD 3-clause license, see the LICENSE file for details.

The SoftDevices from Nordic are licensed under a different license, check the license file in the SoftDevice source directory.

# Packages

No description provided by the author
Package rawterm provides some sort of raw terminal interface, both on hosted systems and baremetal.

# Functions

New16BitUUID returns a new 128-bit UUID based on a 16-bit UUID.
NewDuration returns a new Duration, in units of 0.625µs.
NewUUID returns a new UUID based on the 128-bit (or 16-byte) input.
ParseMAC parses the given MAC address, which must be in 11:22:33:AA:BB:CC format.
ParseUUID parses the given UUID, which must be in 00001234-0000-1000-8000-00805f9b34fb format.

# Constants

Characteristic permission bitfields.
Characteristic permission bitfields.
Characteristic permission bitfields.
Characteristic permission bitfields.
Characteristic permission bitfields.
Characteristic permission bitfields.
Version returns a user-readable string showing the version of the bluetooth package for support purposes.

# Variables

CharacteristicUUIDAerobicHeartRateLowerLimit - Aerobic Heart Rate Lower Limit.
CharacteristicUUIDAerobicHeartRateUpperLimit - Aerobic Heart Rate Upper Limit.
CharacteristicUUIDAerobicThreshold - Aerobic Threshold.
CharacteristicUUIDAge - Age.
CharacteristicUUIDAggregate - Aggregate.
CharacteristicUUIDAlertCategoryID - Alert Category ID.
CharacteristicUUIDAlertCategoryIDBitMask - Alert Category ID Bit Mask.
CharacteristicUUIDAlertLevel - Alert Level.
CharacteristicUUIDAlertNotificationControlPoint - Alert Notification Control Point.
CharacteristicUUIDAlertStatus - Alert Status.
CharacteristicUUIDAltitude - Altitude.
CharacteristicUUIDAnaerobicHeartRateLowerLimit - Anaerobic Heart Rate Lower Limit.
CharacteristicUUIDAnaerobicHeartRateUpperLimit - Anaerobic Heart Rate Upper Limit.
CharacteristicUUIDAnaerobicThreshold - Anaerobic Threshold.
CharacteristicUUIDAnalog - Analog.
CharacteristicUUIDAnalogOutput - Analog Output.
CharacteristicUUIDApparentWindDirection - Apparent Wind Direction.
CharacteristicUUIDApparentWindSpeed - Apparent Wind Speed.
CharacteristicUUIDAppearance - Appearance.
CharacteristicUUIDAppleControlPoint - Apple Control Point.
CharacteristicUUIDAppleDataSource - Apple Data Source.
CharacteristicUUIDAppleEntityAttribute - Apple Entity Attribute.
CharacteristicUUIDAppleEntityUpdate - Apple Entity Update.
CharacteristicUUIDAppleNotificationSource - Apple Notification Source.
CharacteristicUUIDAppleRemoteCommand - Apple Remote Command.
CharacteristicUUIDBarometricPressureTrend - Barometric Pressure Trend.
CharacteristicUUIDBatteryLevel - Battery Level.
CharacteristicUUIDBatteryLevelState - Battery Level State.
CharacteristicUUIDBatteryPowerState - Battery Power State.
CharacteristicUUIDBlinkyButtonState - Blinky Button State.
CharacteristicUUIDBlinkyLEDState - Blinky LED State.
CharacteristicUUIDBloodPressureFeature - Blood Pressure Feature.
CharacteristicUUIDBloodPressureMeasurement - Blood Pressure Measurement.
CharacteristicUUIDBodyCompositionFeature - Body Composition Feature.
CharacteristicUUIDBodyCompositionMeasurement - Body Composition Measurement.
CharacteristicUUIDBodySensorLocation - Body Sensor Location.
CharacteristicUUIDBondManagementControlPoint - Bond Management Control Point.
CharacteristicUUIDBondManagementFeatures - Bond Management Features.
CharacteristicUUIDBootKeyboardInputReport - Boot Keyboard Input Report.
CharacteristicUUIDBootKeyboardOutputReport - Boot Keyboard Output Report.
CharacteristicUUIDBootMouseInputReport - Boot Mouse Input Report.
CharacteristicUUIDButtonlessDFUWithBonds - Buttonless DFU With Bonds.
CharacteristicUUIDButtonlessDFUWithoutBonds - Buttonless DFU Without Bonds.
CharacteristicUUIDCentralAddressResolution - Central Address Resolution.
CharacteristicUUIDCGMFeature - CGM Feature.
CharacteristicUUIDCGMMeasurement - CGM Measurement.
CharacteristicUUIDCGMSessionRunTime - CGM Session Run Time.
CharacteristicUUIDCGMSessionStartTime - CGM Session Start Time.
CharacteristicUUIDCGMSpecificOpsControlPoint - CGM Specific Ops Control Point.
CharacteristicUUIDCGMStatus - CGM Status.
CharacteristicUUIDCrossTrainerData - Cross Trainer Data.
CharacteristicUUIDCSCFeature - CSC Feature.
CharacteristicUUIDCSCMeasurement - CSC Measurement.
CharacteristicUUIDCurrentTime - Current Time.
CharacteristicUUIDCyclingPowerControlPoint - Cycling Power Control Point.
CharacteristicUUIDCyclingPowerFeature - Cycling Power Feature.
CharacteristicUUIDCyclingPowerMeasurement - Cycling Power Measurement.
CharacteristicUUIDCyclingPowerVector - Cycling Power Vector.
CharacteristicUUIDDatabaseChangeIncrement - Database Change Increment.
CharacteristicUUIDDateOfBirth - Date of Birth.
CharacteristicUUIDDateOfThresholdAssessment - Date of Threshold Assessment.
CharacteristicUUIDDateTime - Date Time.
CharacteristicUUIDDateUTC - Date UTC.
CharacteristicUUIDDayDateTime - Day Date Time.
CharacteristicUUIDDayOfWeek - Day of Week.
CharacteristicUUIDDeprecatedFastPairAccountKey - Deprecated Fast Pair Account Key.
CharacteristicUUIDDeprecatedFastPairData - Deprecated Fast Pair Data.
CharacteristicUUIDDeprecatedFastPairKeybasedPairing - Deprecated Fast Pair Key-based Pairing.
CharacteristicUUIDDeprecatedFastPairModelID - Deprecated Fast Pair Model ID.
CharacteristicUUIDDeprecatedFastPairPasskey - Deprecated Fast Pair Passkey.
CharacteristicUUIDDescriptorValueChanged - Descriptor Value Changed.
CharacteristicUUIDDeviceName - Device Name.
CharacteristicUUIDDewPoint - Dew Point.
CharacteristicUUIDDFUControlPoint - DFU Control Point.
CharacteristicUUIDDFUPacket - DFU Packet.
CharacteristicUUIDDigital - Digital.
CharacteristicUUIDDigitalOutput - Digital Output.
CharacteristicUUIDDSTOffset - DST Offset.
CharacteristicUUIDEddystoneActiveSlot - Eddystone Active Slot.
CharacteristicUUIDEddystoneAdvancedAdvertisedTxPower - Eddystone (Advanced) Advertised Tx Power.
CharacteristicUUIDEddystoneAdvancedRemainConnectable - Eddystone (Advanced) Remain Connectable.
CharacteristicUUIDEddystoneAdvertisingInterval - Eddystone Advertising Interval.
CharacteristicUUIDEddystoneADVSlotData - Eddystone ADV Slot Data.
CharacteristicUUIDEddystoneAvancedFactoryReset - Eddystone Avanced Factory Reset.
CharacteristicUUIDEddystoneCapabilities - Eddystone Capabilities.
CharacteristicUUIDEddystoneEIDIdentityKey - Eddystone EID Identity Key.
CharacteristicUUIDEddystoneLockState - Eddystone Lock State.
CharacteristicUUIDEddystonePublicECDHKey - Eddystone Public ECDH Key.
CharacteristicUUIDEddystoneRadioTxPower - Eddystone Radio Tx Power.
CharacteristicUUIDEddystoneUnlock - Eddystone Unlock.
CharacteristicUUIDElevation - Elevation.
CharacteristicUUIDEmailAddress - Email Address.
CharacteristicUUIDExactTime100 - Exact Time 100.
CharacteristicUUIDExactTime256 - Exact Time 256.
CharacteristicUUIDExperimentalButtonlessDFU - Experimental Buttonless DFU.
CharacteristicUUIDFastPairAccountKey - Fast Pair Account Key.
CharacteristicUUIDFastPairData - Fast Pair Data.
CharacteristicUUIDFastPairKeybasedPairing - Fast Pair Key-based Pairing.
CharacteristicUUIDFastPairModelID - Fast Pair Model ID.
CharacteristicUUIDFastPairPasskey - Fast Pair Passkey.
CharacteristicUUIDFatBurnHeartRateLowerLimit - Fat Burn Heart Rate Lower Limit.
CharacteristicUUIDFatBurnHeartRateUpperLimit - Fat Burn Heart Rate Upper Limit.
CharacteristicUUIDFirmwareRevisionString - Firmware Revision String.
CharacteristicUUIDFirstName - First Name.
CharacteristicUUIDFitnessMachineControlPoint - Fitness Machine Control Point.
CharacteristicUUIDFitnessMachineFeature - Fitness Machine Feature.
CharacteristicUUIDFitnessMachineStatus - Fitness Machine Status.
CharacteristicUUIDFiveZoneHeartRateLimits - Five Zone Heart Rate Limits.
CharacteristicUUIDFloorNumber - Floor Number.
CharacteristicUUIDGender - Gender.
CharacteristicUUIDGlucoseFeature - Glucose Feature.
CharacteristicUUIDGlucoseMeasurement - Glucose Measurement.
CharacteristicUUIDGlucoseMeasurementContext - Glucose Measurement Context.
CharacteristicUUIDGustFactor - Gust Factor.
CharacteristicUUIDHardwareRevisionString - Hardware Revision String.
CharacteristicUUIDHeartRateControlPoint - Heart Rate Control Point.
CharacteristicUUIDHeartRateMax - Heart Rate Max.
CharacteristicUUIDHeartRateMeasurement - Heart Rate Measurement.
CharacteristicUUIDHeatIndex - Heat Index.
CharacteristicUUIDHeight - Height.
CharacteristicUUIDHIDControlPoint - HID Control Point.
CharacteristicUUIDHIDInformation - HID Information.
CharacteristicUUIDHipCircumference - Hip Circumference.
CharacteristicUUIDHTTPControlPoint - HTTP Control Point.
CharacteristicUUIDHTTPEntityBody - HTTP Entity Body.
CharacteristicUUIDHTTPHeaders - HTTP Headers.
CharacteristicUUIDHTTPSSecurity - HTTPS Security.
CharacteristicUUIDHTTPStatusCode - HTTP Status Code.
CharacteristicUUIDHumidity - Humidity.
CharacteristicUUIDIDDAnnunciationStatus - IDD Annunciation Status.
CharacteristicUUIDIDDCommandControlPoint - IDD Command Control Point.
CharacteristicUUIDIDDCommandData - IDD Command Data.
CharacteristicUUIDIDDFeatures - IDD Features.
CharacteristicUUIDIDDHistoryData - IDD History Data.
CharacteristicUUIDIDDRecordAccessControlPoint - IDD Record Access Control Point.
CharacteristicUUIDIDDStatus - IDD Status.
CharacteristicUUIDIDDStatusChanged - IDD Status Changed.
CharacteristicUUIDIDDStatusReaderControlPoint - IDD Status Reader Control Point.
CharacteristicUUIDIEEE1107320601RegulatoryCertificationDataList - IEEE 11073-20601 Regulatory Certification Data List.
CharacteristicUUIDIndoorBikeData - Indoor Bike Data.
CharacteristicUUIDIndoorPositioningConfiguration - Indoor Positioning Configuration.
CharacteristicUUIDIntermediateCuffPressure - Intermediate Cuff Pressure.
CharacteristicUUIDIntermediateTemperature - Intermediate Temperature.
CharacteristicUUIDIrradiance - Irradiance.
CharacteristicUUIDLanguage - Language.
CharacteristicUUIDLastName - Last Name.
CharacteristicUUIDLatitude - Latitude.
CharacteristicUUIDLegacyDFUControlPoint - Legacy DFU Control Point.
CharacteristicUUIDLegacyDFUPacket - Legacy DFU Packet.
CharacteristicUUIDLegacyDFUVersion - Legacy DFU Version.
CharacteristicUUIDLNControlPoint - LN Control Point.
CharacteristicUUIDLNFeature - LN Feature.
CharacteristicUUIDLocalEastCoordinate - Local East Coordinate.
CharacteristicUUIDLocalNorthCoordinate - Local North Coordinate.
CharacteristicUUIDLocalTimeInformation - Local Time Information.
CharacteristicUUIDLocationAndSpeed - Location and Speed Characteristic.
CharacteristicUUIDLocationName - Location Name.
CharacteristicUUIDLongitude - Longitude.
CharacteristicUUIDMagneticDeclination - Magnetic Declination.
CharacteristicUUIDMagneticFluxDensity2D - Magnetic Flux Density - 2D.
CharacteristicUUIDMagneticFluxDensity3D - Magnetic Flux Density - 3D.
CharacteristicUUIDManufacturerNameString - Manufacturer Name String.
CharacteristicUUIDMaximumRecommendedHeartRate - Maximum Recommended Heart Rate.
CharacteristicUUIDMeasurementInterval - Measurement Interval.
CharacteristicUUIDMeshProvisioningDataIn - Mesh Provisioning Data In.
CharacteristicUUIDMeshProvisioningDataOut - Mesh Provisioning Data Out.
CharacteristicUUIDMeshProxyDataIn - Mesh Proxy Data In.
CharacteristicUUIDMeshProxyDataOut - Mesh Proxy Data Out.
CharacteristicUUIDMicrobitAccelerometerData - micro:bit Accelerometer Data.
CharacteristicUUIDMicrobitAccelerometerPeriod - micro:bit Accelerometer Period.
CharacteristicUUIDMicrobitButtonAState - micro:bit Button A State.
CharacteristicUUIDMicrobitButtonBState - micro:bit Button B State.
CharacteristicUUIDMicrobitClientEvent - micro:bit Client Event.
CharacteristicUUIDMicrobitClientRequirements - micro:bit Client Requirements.
CharacteristicUUIDMicrobitDFUControl - micro:bit DFU Control.
CharacteristicUUIDMicrobitEvent - micro:bit Event.
CharacteristicUUIDMicrobitLEDMatrixState - micro:bit LED Matrix State.
CharacteristicUUIDMicrobitLEDText - micro:bit LED Text.
CharacteristicUUIDMicrobitMagnetometerBearing - micro:bit Magnetometer Bearing.
CharacteristicUUIDMicrobitMagnetometerData - micro:bit Magnetometer Data.
CharacteristicUUIDMicrobitMagnetometerPeriod - micro:bit Magnetometer Period.
CharacteristicUUIDMicrobitPinADConfiguration - micro:bit Pin AD Configuration.
CharacteristicUUIDMicrobitPinData - micro:bit Pin Data.
CharacteristicUUIDMicrobitPinIOConfiguration - micro:bit Pin I/O Configuration.
CharacteristicUUIDMicrobitPWMControl - micro:bit PWM Control.
CharacteristicUUIDMicrobitRequirements - micro:bit Requirements.
CharacteristicUUIDMicrobitScrollingDelay - micro:bit Scrolling Delay.
CharacteristicUUIDMicrobitTemperature - micro:bit Temperature.
CharacteristicUUIDMicrobitTemperaturePeriod - micro:bit Temperature Period.
CharacteristicUUIDModelNumberString - Model Number String.
CharacteristicUUIDNavigation - Navigation.
CharacteristicUUIDNetworkAvailability - Network Availability.
CharacteristicUUIDNewAler - New Aler.
CharacteristicUUIDObjectActionControlPoint - Object Action Control Point.
CharacteristicUUIDObjectChanged - Object Changed.
CharacteristicUUIDObjectFirstCreated - Object First-Created.
CharacteristicUUIDObjectID - Object ID.
CharacteristicUUIDObjectLastModified - Object Last-Modified.
CharacteristicUUIDObjectListControlPoint - Object List Control Point.
CharacteristicUUIDObjectListFilter - Object List Filter.
CharacteristicUUIDObjectName - Object Name.
CharacteristicUUIDObjectProperties - Object Properties.
CharacteristicUUIDObjectSize - Object Size.
CharacteristicUUIDObjectType - Object Type.
CharacteristicUUIDOTSFeature - OTS Feature.
CharacteristicUUIDPeripheralPreferredConnectionParameters - Peripheral Preferred Connection Parameters.
CharacteristicUUIDPeripheralPrivacyFlag - Peripheral Privacy Flag.
CharacteristicUUIDPLXContinuousMeasurement - PLX Continuous Measurement Characteristic.
CharacteristicUUIDPLXFeatures - PLX Features.
CharacteristicUUIDPLXSpotCheckMeasurement - PLX Spot-Check Measurement.
CharacteristicUUIDPnPID - PnP ID.
CharacteristicUUIDPollenConcentration - Pollen Concentration.
CharacteristicUUIDPosition2D - Position 2D.
CharacteristicUUIDPosition3D - Position 3D.
CharacteristicUUIDPositionQuality - Position Quality.
CharacteristicUUIDPressure - Pressure.
CharacteristicUUIDProtocolMode - Protocol Mode.
CharacteristicUUIDPulseOximetryControlPoint - Pulse Oximetry Control Point.
CharacteristicUUIDRainfall - Rainfall.
CharacteristicUUIDRCFeature - RC Feature.
CharacteristicUUIDRCSettings - RC Settings.
CharacteristicUUIDReconnectionAddress - Reconnection Address.
CharacteristicUUIDReconnectionConfigurationControlPoint - Reconnection Configuration Control Point.
CharacteristicUUIDRecordAccessControlPoint - Record Access Control Point.
CharacteristicUUIDReferenceTimeInformation - Reference Time Information.
CharacteristicUUIDRemovable - Removable.
CharacteristicUUIDReport - Report.
CharacteristicUUIDReportMap - Report Map.
CharacteristicUUIDResolvablePrivateAddressOnly - Resolvable Private Address Only.
CharacteristicUUIDRestingHeartRate - Resting Heart Rate.
CharacteristicUUIDRingerControlPoint - Ringer Control point.
CharacteristicUUIDRingerSetting - Ringer Setting.
CharacteristicUUIDRowerData - Rower Data.
CharacteristicUUIDRSCFeature - RSC Feature.
CharacteristicUUIDRSCMeasurement - RSC Measurement.
CharacteristicUUIDScanIntervalWindow - Scan Interval Window.
CharacteristicUUIDScanRefresh - Scan Refresh.
CharacteristicUUIDSCControlPoint - SC Control Point.
CharacteristicUUIDScientificTemperatureCelsius - Scientific Temperature Celsius.
CharacteristicUUIDSecondaryTimeZone - Secondary Time Zone.
CharacteristicUUIDSensorLocation - Sensor Location.
CharacteristicUUIDSerialNumberString - Serial Number String.
CharacteristicUUIDServiceChanged - Service Changed.
CharacteristicUUIDServiceRequired - Service Required.
CharacteristicUUIDSMP - SMP Characteristic.
CharacteristicUUIDSoftwareRevisionString - Software Revision String.
CharacteristicUUIDSportTypeForAerobicAndAnaerobicThresholds - Sport Type for Aerobic and Anaerobic Thresholds.
CharacteristicUUIDStairClimberData - Stair Climber Data.
CharacteristicUUIDStepClimberData - Step Climber Data.
CharacteristicUUIDString - String.
CharacteristicUUIDSupportedHeartRateRange - Supported Heart Rate Range.
CharacteristicUUIDSupportedInclinationRange - Supported Inclination Range.
CharacteristicUUIDSupportedNewAlertCategory - Supported New Alert Category.
CharacteristicUUIDSupportedPowerRange - Supported Power Range.
CharacteristicUUIDSupportedResistanceLevelRange - Supported Resistance Level Range.
CharacteristicUUIDSupportedSpeedRange - Supported Speed Range.
CharacteristicUUIDSupportedUnreadAlertCategory - Supported Unread Alert Category.
CharacteristicUUIDSystemID - System ID.
CharacteristicUUIDTDSControlPoint - TDS Control Point.
CharacteristicUUIDTemperature - Temperature.
CharacteristicUUIDTemperatureCelsius - Temperature Celsius.
CharacteristicUUIDTemperatureFahrenheit - Temperature Fahrenheit.
CharacteristicUUIDTemperatureMeasurement - Temperature Measurement.
CharacteristicUUIDTemperatureType - Temperature Type.
CharacteristicUUIDThingyAdvertisingParameters - Thingy Advertising Parameters.
CharacteristicUUIDThingyAirQuality - Thingy Air Quality.
CharacteristicUUIDThingyButtonState - Thingy Button State.
CharacteristicUUIDThingyCloudToken - Thingy Cloud Token.
CharacteristicUUIDThingyColor - Thingy Color.
CharacteristicUUIDThingyConfiguration - Thingy Configuration.
CharacteristicUUIDThingyConnectionParameters - Thingy Connection Parameters.
CharacteristicUUIDThingyDeviceName - Thingy Device Name.
CharacteristicUUIDThingyEddystoneURL - Thingy Eddystone URL.
CharacteristicUUIDThingyEuler - Thingy Euler.
CharacteristicUUIDThingyEXTPin - Thingy EXT Pin.
CharacteristicUUIDThingyFWVersion - Thingy FW Version.
CharacteristicUUIDThingyGravityVector - Thingy Gravity Vector.
CharacteristicUUIDThingyHeading - Thingy Heading.
CharacteristicUUIDThingyHumidity - Thingy Humidity.
CharacteristicUUIDThingyLEDState - Thingy LED State.
CharacteristicUUIDThingyMicrophone - Thingy Microphone.
CharacteristicUUIDThingyMotionConfig - Thingy Motion Config.
CharacteristicUUIDThingyMTURequest - Thingy MTU Request.
CharacteristicUUIDThingyOrientation - Thingy Orientation.
CharacteristicUUIDThingyPedometer - Thingy Pedometer.
CharacteristicUUIDThingyPressure - Thingy Pressure.
CharacteristicUUIDThingyQuaternion - Thingy Quaternion.
CharacteristicUUIDThingyRawData - Thingy Raw Data.
CharacteristicUUIDThingyRotationMatrix - Thingy Rotation Matrix.
CharacteristicUUIDThingySoundConfig - Thingy Sound Config.
CharacteristicUUIDThingySpeakerData - Thingy Speaker Data.
CharacteristicUUIDThingySpeakerStatus - Thingy Speaker Status.
CharacteristicUUIDThingyTap - Thingy Tap.
CharacteristicUUIDThingyTemperature - Thingy Temperature.
CharacteristicUUIDThreeZoneHeartRateLimits - Three Zone Heart Rate Limits.
CharacteristicUUIDTimeAccuracy - Time Accuracy.
CharacteristicUUIDTimeBroadcast - Time Broadcast.
CharacteristicUUIDTimeSource - Time Source.
CharacteristicUUIDTimeUpdateControlPoint - Time Update Control Point.
CharacteristicUUIDTimeUpdateState - Time Update State.
CharacteristicUUIDTimeWithDST - Time with DST.
CharacteristicUUIDTimeZone - Time Zone.
CharacteristicUUIDTrainingStatus - Training Status.
CharacteristicUUIDTreadmillData - Treadmill Data.
CharacteristicUUIDTrueWindDirection - True Wind Direction.
CharacteristicUUIDTrueWindSpeed - True Wind Speed.
CharacteristicUUIDTwoZoneHeartRateLimit - Two Zone Heart Rate Limit.
CharacteristicUUIDTxPowerLevel - Tx Power Level.
CharacteristicUUIDUARTRX - UART RX Characteristic.
CharacteristicUUIDUARTTX - UART TX Characteristic.
CharacteristicUUIDUncertainty - Uncertainty.
CharacteristicUUIDUnreadAlertStatus - Unread Alert Status.
CharacteristicUUIDURI - URI.
CharacteristicUUIDUserControlPoint - User Control Point.
CharacteristicUUIDUserIndex - User Index.
CharacteristicUUIDUVIndex - UV Index.
CharacteristicUUIDVO2Max - VO2 Max.
CharacteristicUUIDWaistCircumference - Waist Circumference.
CharacteristicUUIDWeight - Weight.
CharacteristicUUIDWeightMeasurement - Weight Measurement.
CharacteristicUUIDWeightScaleFeature - Weight Scale Feature.
CharacteristicUUIDWindChill - Wind Chill.
DefaultAdapter is the default adapter on the system.
ServiceUUIDAlertNotification - Alert Notification Service.
ServiceUUIDAppleMedia - Apple Media Service.
ServiceUUIDAppleNotificationCenter - Apple Notification Center Service.
ServiceUUIDAutomationIO - Automation IO.
ServiceUUIDBattery - Battery Service.
ServiceUUIDBloodPressure - Blood Pressure.
ServiceUUIDBodyComposition - Body Composition.
ServiceUUIDBondManagement - Bond Management Service.
ServiceUUIDContinuousGlucoseMonitoring - Continuous Glucose Monitoring.
ServiceUUIDCurrentTime - Current Time Service.
ServiceUUIDCyclingPower - Cycling Power.
ServiceUUIDCyclingSpeedAndCadence - Cycling Speed and Cadence.
ServiceUUIDDeviceInformation - Device Information.
ServiceUUIDEddystone - Eddystone.
ServiceUUIDEddystoneConfiguration - Eddystone Configuration Service.
ServiceUUIDEnvironmentalSensing - Environmental Sensing.
ServiceUUIDExperimentalButtonlessDFU - Experimental Buttonless DFU Service.
ServiceUUIDExposureNotification - Exposure Notification Service.
ServiceUUIDFastPair - Fast Pair Service.
ServiceUUIDFirmwareRevision - Firmware Revision.
ServiceUUIDFitnessMachine - Fitness Machine.
ServiceUUIDGenericAccess - Generic Access.
ServiceUUIDGenericAttribute - Generic Attribute.
ServiceUUIDGlucose - Glucose.
ServiceUUIDHealthThermometer - Health Thermometer.
ServiceUUIDHeartRate - Heart Rate.
ServiceUUIDHTTPProxy - HTTP Proxy.
ServiceUUIDHumanInterfaceDevice - Human Interface Device.
ServiceUUIDImmediateAlert - Immediate Alert.
ServiceUUIDIndoorPositioning - Indoor Positioning.
ServiceUUIDInsulinDelivery - Insulin Delivery.
ServiceUUIDInternetProtocolSupport - Internet Protocol Support Service.
ServiceUUIDLegacyDFU - Legacy DFU Service.
ServiceUUIDLinkLoss - Link Loss.
ServiceUUIDLocationAndNavigation - Location and Navigation.
ServiceUUIDMeshProvisioning - Mesh Provisioning Service.
ServiceUUIDMeshProxy - Mesh Proxy Service.
ServiceUUIDMicrobitAccelerometer - micro:bit Accelerometer Service.
ServiceUUIDMicrobitButton - micro:bit Button Service.
ServiceUUIDMicrobitDFUControl - micro:bit DFU Control Service.
ServiceUUIDMicrobitEvent - micro:bit Event Service.
ServiceUUIDMicrobitIOPin - micro:bit IO Pin Service.
ServiceUUIDMicrobitLED - micro:bit LED Service.
ServiceUUIDMicrobitMagnetometer - micro:bit Magnetometer Service.
ServiceUUIDMicrobitTemperature - micro:bit Temperature Service.
ServiceUUIDNextDSTChange - Next DST Change Service.
ServiceUUIDNordicLEDAndButton - Nordic LED and Button Service.
ServiceUUIDNordicUART - Nordic UART Service.
ServiceUUIDObjectTransfer - Object Transfer Service.
ServiceUUIDPhoneAlertStatus - Phone Alert Status Service.
ServiceUUIDPulseOximeter - Pulse Oximeter Service.
ServiceUUIDReconnectionConfiguration - Reconnection Configuration.
ServiceUUIDReferenceTimeUpdate - Reference Time Update Service.
ServiceUUIDRunningSpeedAndCadence - Running Speed and Cadence.
ServiceUUIDScanParameters - Scan Parameters.
ServiceUUIDSecureDFU - Secure DFU Service.
ServiceUUIDSMP - SMP Service.
ServiceUUIDThingyConfiguration - Thingy Configuration Service.
ServiceUUIDThingyMotion - Thingy Motion Service.
ServiceUUIDThingySound - Thingy Sound Service.
ServiceUUIDThingyUI - Thingy UI Service.
ServiceUUIDThingyWeatherStation - Thingy Weather Station Service.
ServiceUUIDTransportDiscovery - Transport Discovery.
ServiceUUIDTxPower - Tx Power.
ServiceUUIDUserData - User Data.
ServiceUUIDWeightScale - Weight Scale.

# Structs

No description provided by the author
Address contains a Bluetooth MAC address.
Advertisement encapsulates a single advertisement instance.
AdvertisementFields contains advertisement fields in structured form.
AdvertisementOptions configures an advertisement instance.
Characteristic is a single characteristic in a service.
CharacteristicConfig contains some parameters for the configuration of a single characteristic.
ConnectionParams are used when connecting to a peripherals.
Device is a connection to a remote peripheral.
DeviceCharacteristic is a BLE characteristic on a connected peripheral device.
DeviceService is a BLE service on a connected peripheral device.
MACAddress contains a Bluetooth address which is a MAC address.
ScanResult contains information from when an advertisement packet was received.
Service is a GATT service to be used in AddService.

# Interfaces

Addresser contains a Bluetooth address, which is a MAC address plus some extra information.
AdvertisementPayload contains information obtained during a scan (see ScanResult).

# Type aliases

CharacteristicPermissions lists a number of basic permissions/capabilities that clients have regarding this characteristic.
Connection is a numeric identifier that indicates a connection handle.
Duration is the unit of time used in BLE, in 0.625µs units.
MAC represents a MAC address, in little endian format.
UUID is a single UUID as used in the Bluetooth stack.