Categorygithub.com/GKoSon/gobluetooth
modulepackage
0.0.0-20220609083521-65b3249fb864
Repository: https://github.com/gkoson/gobluetooth.git
Documentation: pkg.go.dev

# README

说明

微信文章:

第一次提交:准备简化的代码仓库

项目来源git clone https://github.com/tinygo-org/bluetooth.git 克隆TingGo仓库 commit e75811786c7ec1f2890e1ff0508cc28d5ac5de62 release: update for v0.4.0

因为我是WIN10+VSCODE开发 再拖到树莓派运行 所以我删除无关紧要的东西 执行rm.cmd 就获得当前项目的一切! 描述一下如何执行这个rm.cmd { 直接双击rm.cmd 会失败的 因为win的bash不支持通配符*

根据VSCODE的启发(微信文章:) 可以换一个bash C:\Program Files\Git\bin 这里有3个 我选择这里的bash.exe 本来准备 C:\Program Files\Git\bin\bash.exe rm.cmd 的 发现路径有问题 直接 bash.exe rm.cmd 就成功了! 应该是因为前面已经把git配置到系统环境变量啦! }

建立本仓库 是为了方便自己再调用它! 计划修改 1--HCI接口切换 2--断开检查

第二次提交: 全局替换 前面仓库已经推上去 本地写代码 examples\nusclient\main.go 引用它 以前是 import "tinygo.org/x/bluetooth" 我就写 import "GKoSon/gobluetooth" 测试失败! 因为我这个项目的mod文件还是原始的 本次提交 做全局替换 tinygo.org/x/bluetooth -> GKoSon/gobluetooth module tinygo.org/x/bluetooth

第三次提交:全局替换 本地测试还是不行

在本地执行go mod init xx 发现mod文件只有2行 没有关联到我的仓库 我手动修改一下本地的mod文件如图 ... module xx

go 1.17

require ( github.com/GKoSon/gobluetooth v1.2.3 ) ... 【后面的v1.2.3是随便写的 根据ssh提示来的】 在做单个文件go build main.go 看到有去拉我的代码啦! go mod download github.com/GKoSon/gobluetooth root@raspberrypi:/home/pi/PK# go mod download github.com/GKoSon/gobluetooth go mod download: github.com/GKoSon/[email protected]: invalid version: unknown revision v1.2.3 最后失败 换一个姿势 root@raspberrypi:/home/pi/PK# go mod tidy xx imports GKoSon/gobluetooth: github.com/GKoSon/[email protected]: reading github.com/GKoSon/gobluetooth/go.mod at revision v1.2.3: unknown revision v1.2.3 也是失败!!!

所以问题是:go.mod文件里面require项目最后的版本填写多少呢? 参考:http://t.zoukankan.com/twoheads-p-12889526.html

https://github.com/GKoSon/gobluetooth/commits/main 看到最后一个commit是 462c67d2a1ba951d39b7587e6e53053764b73284 我就写这个! ... module xx

go 1.17

require github.com/GKoSon/gobluetooth v0.0.0-20220422050553-462c67d2a1ba ... 执行报错

root@raspberrypi:/home/pi/PK# go mod tidy xx imports GKoSon/gobluetooth: github.com/GKoSon/[email protected]: parsing go.mod: module declares its path as: GKoSon/gobluetooth but was required as: github.com/GKoSon/gobluetooth

修改以后 再来一次 root@raspberrypi:/home/pi/PK# go mod tidy xx imports GKoSon/gobluetooth: malformed module path "GKoSon/gobluetooth": missing dot in first path element root@raspberrypi:/home/pi/PK# cat go.mod module xx

go 1.17

require GKoSon/gobluetooth v0.0.0-20220422050553-462c67d2a1ba root@raspberrypi:/home/pi/PK#

百度一下 好像是有问题 "一个网络地址去下载,在下载前先CheckPath检查其合法性" 好像明白了 那就再次全局修改一下

以前是 import "tinygo.org/x/bluetooth" 前面写 import "GKoSon/gobluetooth" 现在写import "github.com/GKoSon/gobluetooth" 这就是下载的路径啊!!!! 测试一下 【感觉还是fork一下 在修改fork的仓库+replace的方式比较简单】

第四次提交:成功了 前面提交以后 我自己记录一下commit 手动修改本地文件 ... module xx

go 1.17

require github.com/GKoSon/gobluetooth a31499c265a17b1894e823ef49246b2b45d3a555 ... 现在执行 go mod tidy 可以成功了!

root@raspberrypi:/home/pi/PK# go mod tidy
go: downloading github.com/GKoSon/gobluetooth v0.0.0-20220422055325-a31499c265a1 root@raspberrypi:/home/pi/PK# go build main.go

command-line-arguments

./main.go:121:13: device.IsConnected undefined (type *bluetooth.Device has no field or method IsConnected) root@raspberrypi:/home/pi/PK#

再看一下 GO帮我做的事情 (其实没有意义) root@raspberrypi:/home/pi/PK# cat go.mod module xx

go 1.17

require github.com/GKoSon/gobluetooth v0.0.0-20220422055325-a31499c265a1

require ( github.com/fatih/structs v1.1.0 // indirect github.com/godbus/dbus/v5 v5.0.3 // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect github.com/muka/go-bluetooth v0.0.0-20210812063148-b6c83362e27d // indirect github.com/sirupsen/logrus v1.6.0 // indirect golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6 // indirect )

本地的单例程序上传上来 可以独立在PI运行的! 修改需要我自己的函数!

第五次提交: 直接把下面文件 放在台湾树莓派运行 流程如下 pi@raspberrypi:/XX $ go build main.go main.go:10:2: no required module provides package github.com/GKoSon/gobluetooth: go.mod file not found in current directory or any parent directory; see 'go help modules' pi@raspberrypi:/XX $ go mod init xx go: creating new go.mod: module xx go: to add module requirements and sums: go mod tidy pi@raspberrypi:/XX $ go mod tidy go: finding module for package github.com/GKoSon/gobluetooth go: downloading github.com/GKoSon/gobluetooth v0.0.0-20220422070120-588124614c38 go: found github.com/GKoSon/gobluetooth in github.com/GKoSon/gobluetooth v0.0.0-20220422070120-588124614c38 go: downloading github.com/godbus/dbus/v5 v5.0.3 go: downloading github.com/sirupsen/logrus v1.6.0 go: downloading github.com/stretchr/testify v1.6.1 go: downloading github.com/konsorten/go-windows-terminal-sequences v1.0.3 go: downloading golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6 go: downloading github.com/davecgh/go-spew v1.1.1 go: downloading github.com/pmezard/go-difflib v1.0.0 go: downloading gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c pi@raspberrypi:/XX $ go build main.go main.go:10:2: found packages bluetooth (adapter.go) and main (koson_pi_nus.go) in /home/pi/go/pkg/mod/github.com/!g!ko!son/[email protected] pi@raspberrypi:~/XX $ 这是因为我自己代码里面koson_pi_nus.go也有mian.go 提交一次del它

第六次提交: 本地写代码 如下 可以的 操作是和上面说的一样 利用mod 自动拉 如果更新mod 就手动把V1.2.3修改为最后的commit

package main

// This example implements a NUS (Nordic UART Service) client. See nusserver for // details.

import ( "log" "time"

bluetooth "github.com/GKoSon/gobluetooth"

)

var ( serviceUUID = bluetooth.ServiceUUIDNordicUART rxUUID = bluetooth.CharacteristicUUIDUARTRX txUUID = bluetooth.CharacteristicUUIDUARTTX )

var adapter = bluetooth.DefaultAdapter

const target_name = "M_KOSON"

var runCnt int64 = 0

func oneloop() { // Enable BLE interface. //STEP 准备通过这个接口 选择不同HCI err := adapter.Enable() if err != nil { log.Printf("could not enable the BLE stack:%v", err.Error()) return }

// The address to connect to. Set during scanning and read afterwards.
var foundDevice bluetooth.ScanResult

// Scan for NUS peripheral.
runCnt++
log.Printf("Scanning...%d", runCnt)
err = adapter.Scan(func(adapter *bluetooth.Adapter, result bluetooth.ScanResult) {
	if !result.AdvertisementPayload.HasServiceUUID(serviceUUID) {
		return
	}
	/*加强停止Scan函数的限制条件*/
	/*条件1--从机必须有名字 而且符合约定*/
	log.Printf("Scanned MAC %s", result.Address.String())
	if target_name != result.AdvertisementPayload.LocalName() {
		log.Printf("Failed name")
		return
	}
	log.Printf("Scanned name %s", result.LocalName())
	/*条件2--从机连接成功*/
	d, e := adapter.Connect(result.Address, bluetooth.ConnectionParams{})
	if e != nil {
		log.Printf("Failed Connect %v %v", d, e)
		return
	}

	foundDevice = result

	// Stop the scan.
	err := adapter.StopScan()
	if err != nil {
		// Unlikely, but we can't recover from this.
		log.Printf("Failed StopScan %v ", err.Error())
	}
})

if err != nil {
	log.Printf("Failed Scan %v ", err.Error())
	return
}

// Found a NUS peripheral. Connect to it.
device, err := adapter.Connect(foundDevice.Address, bluetooth.ConnectionParams{})
if err != nil {
	log.Printf("TG Failed to connect: %v ", err.Error())
	return
}

// Connected. Look up the Nordic UART Service.
log.Printf("Discovering service...")
services, err := device.DiscoverServices([]bluetooth.UUID{serviceUUID})
if err != nil {
	println("Failed to discover the Nordic UART Service:", err.Error())
	return
}
service := services[0]

// Get the two characteristics present in this service.
chars, err := service.DiscoverCharacteristics([]bluetooth.UUID{rxUUID, txUUID})
if err != nil {
	println("Failed to discover RX and TX characteristics:", err.Error())
	return
}
var rx bluetooth.DeviceCharacteristic
var tx bluetooth.DeviceCharacteristic
if chars[0].UUID() == txUUID {
	tx = chars[0]
	rx = chars[1]
} else {
	tx = chars[1]
	rx = chars[0]
}
log.Printf("RX %v\r\n", rx)
log.Printf("TX %v\r\n", tx)
log.Printf("DiscoverCharacteristics:%+v\r\n", chars)

// Enable notifications to receive incoming data.
err = tx.EnableNotifications(func(value []byte) {
	log.Printf("PI recv %d bytes: %+v\r\n", len(value), value)
})
if err != nil {
	log.Printf("Failed EnableNotifications %+v\r\n", err.Error())
	return
}

log.Printf("Connected.When NODE disconnect.This pid while Exit\r\n")
/*等待从机断开 PI从不发消息*/
for {
	if !device.IsConnected() {
		log.Printf("device GoodBye\r\n")
		return
	}
	time.Sleep(time.Microsecond * 500)
}

}

func main() { for { oneloop() } }

/* 程序逻辑 main是死循环 也就是一旦oneloop()调用return那就继续下一次 正常retun是等待BLE链路的标记位

*/

现在小结一下两种思路 1---就是我这个 把别人的拉下来 rm别人的.git文件 初始化自己的git文件 把代码推上来 全局修改仓库里面的mod的包名 现在可以自己本地引用这个新的包了 和别人的 完全脱钩 你感觉不到别人

2--我另外一个fork的 把别人的fork到自己GitHub 把自己这个仓库拉下来 自己随便ADD函数什么的 自己修改 在推上去

现在不可以自己本地引用这个新的包 因为没有新包呀 本地的代码 和前面一样 还是在使用原始仓库的包 想使用自己fork的这个的修改的话 那就自己把本地文件的mod文件修改一下 采用replace的关键字 从一个云端 切换到 另外一个云端

准备微信写一个文章:攻城狮金华

# Packages

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

# 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.
No description provided by the author

# Constants

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.
No description provided by the author
DefaultAdapter is the default adapter on the system.
No description provided by the author
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.
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.

# 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

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.