Categorygithub.com/tinygo-org/cbgo
modulepackage
0.0.4
Repository: https://github.com/tinygo-org/cbgo.git
Documentation: pkg.go.dev

# README

cbgo

cbgo implements Go bindings for CoreBluetooth.

Documentation

For documentation, see the CoreBluetooth docs.

Examples are in the examples directory.

Scope

cbgo aims to implement all functionality that is supported in macOS 10.13.

Naming

Function and type names in cbgo are intended to match the corresponding CoreBluetooth functionality as closely as possible. There are a few (consistent) deviations:

  • All cbgo identifiers start with a capital letter to make them public.
  • Named arguments in CoreBluetooth functions are eliminated.
  • Properties are implemented as a pair of functions (PropertyName and SetPropertyName).

Issues

There are definitely memory leaks. ARC is not compatible with cgo, so objective C memory has to be managed manually. I didn't see a set of consistent guidelines for object ownership in the CoreBluetooth documentation, so cbgo errs on the side of leaking. Hopefully this is only an issue for very long running processes! Any fixes here are much appreciated.

# Packages

No description provided by the author

# Functions

MustParseUUID is like ParseUUID except it panics on failure.
ParseUUID parses a string representing a 16-bit or 128-bit UUID.
ParseUUID128 parses a UUID string with the form: 01234567-89ab-cdef-0123-456789abcdef.
ParseUUID16 parses a UUID string with the form: 1234.
SetLog replaces the cbgo logger with a custom one.
SetLogLevel configures the cbgo logger to use the specified log level.
UUID16 constructs a 128-bit UUID from a 16-element byte slice.
UUID16 constructs a 16-bit UUID from a uint16.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

AdvData represents the configurable portion of outgoing advertisements.
AdvFields represents the contents of an advertisement received during scanning.
No description provided by the author
CentralManagerDelegateBase implements the CentralManagerDelegate interface with stub functions.
NSError: https://developer.apple.com/documentation/foundation/nserror.
PeripheralDelegateBase implements the PeripheralDelegate interface with stub functions.
PeripheralManagerDelegateBase implements the PeripheralManagerDelegate interface with stub functions.

# Interfaces

CentralManagerDelegate: https://developer.apple.com/documentation/corebluetooth/cbcentralmanagerdelegate.
PeripheralDelegate: https://developer.apple.com/documentation/corebluetooth/cbperipheraldelegate.
https://developer.apple.com/documentation/corebluetooth/cbperipheralmanagerdelegate.

# Type aliases

UUID is a 16-bit or 128-bit UUID.