Documentation
¶
Index ¶
- func IsASCIIPrintable(data []byte) bool
- func SetLogLevel(level slog.Level)
- func UseBluetoothPrivileges() error
- type Adapter
- func (a *Adapter) CloseSession(session Session) error
- func (a *Adapter) ConnectBle(session Session, addr Address, param ConnParameter, role ConnRole, ...) (BleConnection, error)
- func (a *Adapter) ConnectBleSimple(session Session, addr Address) (BleConnection, error)
- func (a *Adapter) DeregisterBle(session Session) error
- func (a *Adapter) DeregisterGattClient(session Session) error
- func (a *Adapter) DisableRadio(session Session) error
- func (a *Adapter) DisconnectBle(conn BleConnection) error
- func (a *Adapter) DiscoverServices(session Session, conn BleConnection) error
- func (a *Adapter) EnableRadio(session Session) error
- func (a *Adapter) GetRadioState() (RadioState, error)
- func (a *Adapter) GetSupportedSession() int
- func (a *Adapter) IsBleSupported() bool
- func (a *Adapter) NotifyCharacteristic(session Session, conn BleConnection, uuid CharacteristicUuid) (*Notification, error)
- func (a *Adapter) OpenSession(sessionType SessionType) (Session, error)
- func (a *Adapter) ReadCharacteristic(session Session, conn BleConnection, uuid CharacteristicUuid) (CharacteristicValue, error)
- func (a *Adapter) RegisterBle(session Session) error
- func (a *Adapter) RegisterGattClient(session Session) error
- func (a *Adapter) RetrieveGattDatabase(conn BleConnection) (GattService, error)
- func (a *Adapter) WriteCharacteristicWithResponse(session Session, conn BleConnection, uuid CharacteristicUuid, ...) (CharacteristicValue, error)
- func (a *Adapter) WriteCharacteristicWithoutResponse(session Session, conn BleConnection, uuid CharacteristicUuid, ...) error
- type Address
- type BleConnection
- type CharacteristicUuid
- type CharacteristicValue
- type CharacteristicValueBlob
- type CharacteristicValueInt16
- type CharacteristicValueInt32
- type CharacteristicValueInt8
- type CharacteristicValueKind
- type CharacteristicValueUint16
- type CharacteristicValueUint32
- type CharacteristicValueUint8
- type ConnParameter
- type ConnPriority
- type ConnRole
- type GattService
- type Notification
- type RadioState
- type Session
- type SessionType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsASCIIPrintable ¶
func SetLogLevel ¶
func UseBluetoothPrivileges ¶
func UseBluetoothPrivileges() error
Types ¶
type Adapter ¶
type Adapter struct{}
func NewAdapter ¶
func (*Adapter) CloseSession ¶
func (*Adapter) ConnectBle ¶
func (a *Adapter) ConnectBle( session Session, addr Address, param ConnParameter, role ConnRole, priority ConnPriority, ) (BleConnection, error)
func (*Adapter) ConnectBleSimple ¶
func (a *Adapter) ConnectBleSimple(session Session, addr Address) (BleConnection, error)
func (*Adapter) DeregisterBle ¶
func (*Adapter) DeregisterGattClient ¶
func (*Adapter) DisableRadio ¶
func (*Adapter) DisconnectBle ¶
func (a *Adapter) DisconnectBle(conn BleConnection) error
func (*Adapter) DiscoverServices ¶
func (a *Adapter) DiscoverServices(session Session, conn BleConnection) error
func (*Adapter) EnableRadio ¶
func (*Adapter) GetRadioState ¶
func (a *Adapter) GetRadioState() (RadioState, error)
func (*Adapter) GetSupportedSession ¶
func (*Adapter) IsBleSupported ¶
func (*Adapter) NotifyCharacteristic ¶
func (a *Adapter) NotifyCharacteristic( session Session, conn BleConnection, uuid CharacteristicUuid, ) (*Notification, error)
func (*Adapter) OpenSession ¶
func (a *Adapter) OpenSession(sessionType SessionType) (Session, error)
func (*Adapter) ReadCharacteristic ¶
func (a *Adapter) ReadCharacteristic( session Session, conn BleConnection, uuid CharacteristicUuid, ) (CharacteristicValue, error)
func (*Adapter) RegisterBle ¶
func (*Adapter) RegisterGattClient ¶
func (*Adapter) RetrieveGattDatabase ¶
func (a *Adapter) RetrieveGattDatabase(conn BleConnection) (GattService, error)
func (*Adapter) WriteCharacteristicWithResponse ¶
func (a *Adapter) WriteCharacteristicWithResponse( session Session, conn BleConnection, uuid CharacteristicUuid, value CharacteristicValueKind, ) (CharacteristicValue, error)
func (*Adapter) WriteCharacteristicWithoutResponse ¶
func (a *Adapter) WriteCharacteristicWithoutResponse( session Session, conn BleConnection, uuid CharacteristicUuid, value CharacteristicValueKind, ) error
type BleConnection ¶
type BleConnection struct {
// contains filtered or unexported fields
}
func (BleConnection) String ¶
func (conn BleConnection) String() string
type CharacteristicUuid ¶
type CharacteristicUuid struct {
Bytes [16]byte
}
func NewCharacteristicUuidFromString ¶
func NewCharacteristicUuidFromString(uuid string) (CharacteristicUuid, error)
func (CharacteristicUuid) String ¶
func (uuid CharacteristicUuid) String() string
type CharacteristicValue ¶
type CharacteristicValue struct {
Value CharacteristicValueKind
}
type CharacteristicValueBlob ¶
type CharacteristicValueBlob struct{ V []byte }
type CharacteristicValueInt16 ¶
type CharacteristicValueInt16 struct{ V int16 }
type CharacteristicValueInt32 ¶
type CharacteristicValueInt32 struct{ V int32 }
type CharacteristicValueInt8 ¶
type CharacteristicValueInt8 struct{ V int8 }
type CharacteristicValueKind ¶
type CharacteristicValueKind interface {
// contains filtered or unexported methods
}
type CharacteristicValueUint16 ¶
type CharacteristicValueUint16 struct{ V uint16 }
type CharacteristicValueUint32 ¶
type CharacteristicValueUint32 struct{ V uint32 }
type CharacteristicValueUint8 ¶
type CharacteristicValueUint8 struct{ V uint8 }
type ConnParameter ¶
type ConnParameter int
const ( ParameterMax ConnParameter = C.ACE_BT_BLE_CONN_PARAM_MAX ParameterHigh ConnParameter = C.ACE_BT_BLE_CONN_PARAM_HIGH ParameterBalanced ConnParameter = C.ACE_BT_BLE_CONN_PARAM_BALANCED ParameterLow ConnParameter = C.ACE_BT_BLE_CONN_PARAM_LOW ParameterUltraLow ConnParameter = C.ACE_BT_BLE_CONN_PARAM_ULTRA_LOW )
type ConnPriority ¶
type ConnPriority int
const ( PriorityLow ConnPriority = C.ACE_BT_BLE_CONN_PRIO_LOW PriorityMedium ConnPriority = C.ACE_BT_BLE_CONN_PRIO_MEDIUM PriorityHigh ConnPriority = C.ACE_BT_BLE_CONN_PRIO_HIGH PriorityDedicated ConnPriority = C.ACE_BT_BLE_CONN_PRIO_DEDICATED )
type ConnRole ¶
type ConnRole int
const ( RoleClient ConnRole = C.ACEBT_BLE_GATT_CLIENT_ROLE RoleSocket ConnRole = C.ACEBT_BLE_SOCKET )
type GattService ¶
type GattService struct {
// contains filtered or unexported fields
}
type Notification ¶
type Notification struct {
C <-chan CharacteristicValue
Stop func() error
}
type RadioState ¶
type RadioState int
const ( StateDisabled RadioState = C.ACEBT_STATE_DISABLED StateEnabled RadioState = C.ACEBT_STATE_ENABLED StateEnabling RadioState = C.ACEBT_STATE_ENABLING StateDisabling RadioState = C.ACEBT_STATE_DISABLING )
type SessionType ¶
type SessionType int
const ( SessionBle SessionType = C.ACEBT_SESSION_TYPE_BLE SessionDual SessionType = C.ACEBT_SESSION_TYPE_DUAL_MODE SessionClassic SessionType = C.ACEBT_SESSION_TYPE_CLASSIC SessionNone SessionType = C.ACEBT_SESSION_TYPE_NONE )
Click to show internal directories.
Click to hide internal directories.