gokindlebt

package module
v0.0.0-...-2c361fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 11 Imported by: 0

README

gokindlebt

KindleBT Golang API

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsASCIIPrintable

func IsASCIIPrintable(data []byte) bool

func SetLogLevel

func SetLogLevel(level slog.Level)

func UseBluetoothPrivileges

func UseBluetoothPrivileges() error

Types

type Adapter

type Adapter struct{}

func NewAdapter

func NewAdapter() (Adapter, error)

func (*Adapter) CloseSession

func (a *Adapter) CloseSession(session Session) error

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 (a *Adapter) DeregisterBle(session Session) error

func (*Adapter) DeregisterGattClient

func (a *Adapter) DeregisterGattClient(session Session) error

func (*Adapter) DisableRadio

func (a *Adapter) DisableRadio(session Session) error

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 (a *Adapter) EnableRadio(session Session) error

func (*Adapter) GetRadioState

func (a *Adapter) GetRadioState() (RadioState, error)

func (*Adapter) GetSupportedSession

func (a *Adapter) GetSupportedSession() int

func (*Adapter) IsBleSupported

func (a *Adapter) IsBleSupported() bool

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 (a *Adapter) RegisterBle(session Session) error

func (*Adapter) RegisterGattClient

func (a *Adapter) RegisterGattClient(session Session) error

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 Address

type Address struct {
	Bytes [6]byte
}

func NewAddressFromString

func NewAddressFromString(addr string) (Address, error)

func (Address) String

func (addr Address) String() string

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 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 Session

type Session struct {
	// contains filtered or unexported fields
}

func (Session) String

func (session Session) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL