modulepackage
0.0.0-20171229162446-c1d21c164cf8
Repository: https://github.com/currantlabs/ble.git
Documentation: pkg.go.dev
# README
bt
bt is a Bluetooth library for Go; its API is still under active development, and may change without warning.
# Functions
AddService adds a service to database.
AdvertiseIBeacon advertises iBeacon with specified parameters.
AdvertiseIBeaconData advertise iBeacon with given manufacturer data.
AdvertiseNameAndServices advertises device name, and specified service UUIDs.
Connect searches for and connects to a Peripheral which matches specified condition.
Contains returns a boolean reporting whether u is in the slice s.
Dial ...
Find ...
MustParse parses a standard-format UUID string, like Parse, but panics in case of error.
Name returns name of know services, characteristics, or descriptors.
NewAddr creates an Addr from string.
NewCharacteristic creates and returns a Characteristic.
NewDescriptor creates and returns a Descriptor.
NewNotifier ...
NewRequest returns a default implementation of Request.
NewResponseWriter ...
NewService creates and initialize a new Service using u as it's UUID.
Parse parses a standard-format UUID string, such as "1800" or "34DA3AD1-7110-41A1-B1EF-4430F509CDE7".
RemoveAllServices removes all services that are currently in the database.
Reverse returns a reversed copy of u.
Scan starts scanning.
SetDefaultDevice returns the default HCI device.
SetServices set the specified service to the database.
Stop detatch the GATT server from a peripheral device.
UUID16 converts a uint16 (such as 0x1800) to a UUID.
WithSigHandler ...
# Constants
may be brocasted.
supports extended properties.
supports Indications.
supports notifications.
may be read.
supports signed write.
may be written to, with a reply.
may be written to, with no reply.
DefaultMTU defines the default MTU of ATT protocol including 3 bytes of ATT header.
ErrAttrNotFound means no attribute found within the given attribute handle range.
ErrAttrNotLong means the attribute cannot be read or written using the Read Blob Request.
ErrAuthentication means the attribute requires authentication before it can be read or written.
ErrAuthorization means the attribute requires authorization before it can be read or written.
ErrInsuffEnc means the attribute requires encryption before it can be read or written.
ErrInsuffEncrKeySize means the Encryption Key Size used for encrypting this link is insufficient.
ErrInsuffResources means insufficient resources to complete the request.
ErrInvalAttrValueLen means the attribute value length is invalid for the operation.
ErrInvalidHandle means the attribute handle given was not valid on this server.
ErrInvalidOffset means the specified was past the end of the attribute.
ErrInvalidPDU means the attribute PDU was invalid.
ErrPrepQueueFull means too many prepare writes have been queued.
ErrReadNotPerm eans the attribute cannot be read.
ErrReqNotSupp means the attribute server does not support the request received from the client.
ErrSuccess measn the operation is success.
ErrUnlikely means the attribute request that was requested has encountered an error that was unlikely, and therefore could not be completed as requested.
ErrUnsuppGrpType means the attribute type is not a supported grouping attribute as defined by a higher layer specification.
ErrWriteNotPerm eans the attribute cannot be written.
MaxMTU is maximum of ATT_MTU, which is 512 bytes of value length, plus 3 bytes of ATT header.
# Variables
UUIDs ...
Battery Service.
UUIDs ...
UUIDs ...
Current Time Service.
Device Information.
UUIDs ...
ErrDefaultDevice ...
ErrEIRPacketTooLong is the error returned when an AdvertisingPacket or ScanResponsePacket is too long.
ErrNotImplemented means the functionality is not implemented.
Generic Access.
Generic Attribute.
Human Interface Device.
UUIDs ...
UUIDs ...
UUIDs ...
UUIDs ...
UUIDs ...
UUIDs ...
UUIDs ...
UUIDs ...
# Structs
A Characteristic is a BLE characteristic.
Descriptor is a BLE descriptor.
A Profile is composed of one or more services necessary to fulfill a use case.
A Service is a BLE service.
ServiceData ...
# Interfaces
Addr represents a network end point address.
Advertisement ...
A Client is a GATT client.
Conn implements a L2CAP connection.
Device ...
Notifier ...
A NotifyHandler handles GATT requests.
A ReadHandler handles GATT requests.
Request ...
ResponseWriter ...
A WriteHandler handles GATT requests.
# Type aliases
AdvFilter returns true if the advertisement matches specified condition.
AdvHandler handles advertisement.
ATTError is the error code of Attribute Protocol [Vol 3, Part F, 3.4.1.1].
A NotificationHandler handles notification or indication from a server.
NotifyHandlerFunc is an adapter to allow the use of ordinary functions as Handlers.
Property ...
ReadHandlerFunc is an adapter to allow the use of ordinary functions as Handlers.
A UUID is a BLE UUID.
WriteHandlerFunc is an adapter to allow the use of ordinary functions as Handlers.