corebluetooth

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Rendered for darwin/amd64

Overview

Package corebluetooth provides purego-based Go bindings for the macOS CoreBluetooth framework.

Apple documentation: https://developer.apple.com/documentation/corebluetooth

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CBAdvertisementDataIsConnectable

func CBAdvertisementDataIsConnectable() uintptr

@constant CBAdvertisementDataIsConnectable @discussion An NSNumber (Boolean) indicating whether or not the advertising event type was connectable. This can be used to determine whether or not a peripheral is connectable in that instant.

func CBAdvertisementDataLocalNameKey

func CBAdvertisementDataLocalNameKey() uintptr

@constant CBAdvertisementDataLocalNameKey @discussion A <code>NSString</code> containing the local name of a peripheral.

func CBAdvertisementDataManufacturerDataKey

func CBAdvertisementDataManufacturerDataKey() uintptr

@constant CBAdvertisementDataManufacturerDataKey @discussion A <code>NSData</code> object containing the manufacturer data of a peripheral.

func CBAdvertisementDataOverflowServiceUUIDsKey

func CBAdvertisementDataOverflowServiceUUIDsKey() uintptr

@constant CBAdvertisementDataOverflowServiceUUIDsKey @discussion A list of one or more <code>CBUUID</code> objects, representing <code>CBService</code> UUIDs that were found in the "overflow" area of the advertising data. Due to the nature of the data stored in this area, UUIDs listed here are "best effort" and may not always be accurate. @see startAdvertising:

func CBAdvertisementDataServiceDataKey

func CBAdvertisementDataServiceDataKey() uintptr

@constant CBAdvertisementDataServiceDataKey @discussion A dictionary containing service-specific advertisement data. Keys are <code>CBUUID</code> objects, representing <code>CBService</code> UUIDs. Values are <code>NSData</code> objects.

func CBAdvertisementDataServiceUUIDsKey

func CBAdvertisementDataServiceUUIDsKey() uintptr

@constant CBAdvertisementDataServiceUUIDsKey @discussion A list of one or more <code>CBUUID</code> objects, representing <code>CBService</code> UUIDs.

func CBAdvertisementDataSolicitedServiceUUIDsKey

func CBAdvertisementDataSolicitedServiceUUIDsKey() uintptr

@constant CBAdvertisementDataSolicitedServiceUUIDsKey @discussion A list of one or more <code>CBUUID</code> objects, representing <code>CBService</code> UUIDs.

func CBAdvertisementDataTxPowerLevelKey

func CBAdvertisementDataTxPowerLevelKey() uintptr

@constant CBAdvertisementDataTxPowerLevelKey @discussion A <code>NSNumber</code> containing the transmit power of a peripheral.

func CBCentralManagerOptionRestoreIdentifierKey

func CBCentralManagerOptionRestoreIdentifierKey() uintptr

@const CBCentralManagerOptionRestoreIdentifierKey @discussion An NSString containing a unique identifier (UID) for the <code>CBCentralManager</code> that is being instantiated. This UID is used by the system to identify a specific <code>CBCentralManager</code> instance for restoration and, therefore, must remain the same for subsequent application executions in order for the manager to be restored. @see initWithDelegate:queue:options: @seealso centralManager:willRestoreState:

func CBCentralManagerOptionShowPowerAlertKey

func CBCentralManagerOptionShowPowerAlertKey() uintptr

@const CBCentralManagerOptionShowPowerAlertKey @discussion An NSNumber (Boolean) indicating that the system should, if Bluetooth is powered off when <code>CBCentralManager</code> is instantiated, display a warning dialog to the user. @see initWithDelegate:queue:options:

func CBCentralManagerRestoredStatePeripheralsKey

func CBCentralManagerRestoredStatePeripheralsKey() uintptr

@const CBCentralManagerRestoredStatePeripheralsKey @discussion An NSArray of <code>CBPeripheral</code> objects containing all peripherals that were connected or pending connection at the time the application was terminated by the system. When possible, all known information for each peripheral will be restored, including any discovered services, characteristics and descriptors, as well as characteristic notification states. @see centralManager:willRestoreState: @seealso connectPeripheral:options:

func CBCentralManagerRestoredStateScanOptionsKey

func CBCentralManagerRestoredStateScanOptionsKey() uintptr

@const CBCentralManagerRestoredStateScanOptionsKey @discussion An NSDictionary containing the scan options at the time the application was terminated by the system. @see centralManager:willRestoreState: @seealso scanForPeripheralsWithServices:options:

func CBCentralManagerRestoredStateScanServicesKey

func CBCentralManagerRestoredStateScanServicesKey() uintptr

@const CBCentralManagerRestoredStateScanServicesKey @discussion An NSArray of <code>CBUUID</code> objects containing the service(s) being scanned for at the time the application was terminated by the system. @see centralManager:willRestoreState: @seealso scanForPeripheralsWithServices:options:

func CBCentralManagerScanOptionAllowDuplicatesKey

func CBCentralManagerScanOptionAllowDuplicatesKey() uintptr

@const CBCentralManagerScanOptionAllowDuplicatesKey @discussion An NSNumber (Boolean) indicating that the scan should run without duplicate filtering. By default, multiple discoveries of the same peripheral are coalesced into a single discovery event. Specifying this option will cause a discovery event to be generated every time the peripheral is seen, which may be many times per second. This can be useful in specific situations, such as making a connection based on a peripheral's RSSI, but may have an adverse affect on battery-life and application performance. @see scanForPeripheralsWithServices:options:

func CBCentralManagerScanOptionSolicitedServiceUUIDsKey

func CBCentralManagerScanOptionSolicitedServiceUUIDsKey() uintptr

@const CBCentralManagerScanOptionSolicitedServiceUUIDsKey @discussion An NSArray of <code>CBUUID</code> objects respresenting service UUIDs. Causes the scan to also look for peripherals soliciting any of the services contained in the list. @see scanForPeripheralsWithServices:options:

func CBConnectPeripheralOptionEnableAutoReconnect

func CBConnectPeripheralOptionEnableAutoReconnect() uintptr

@const CBConnectPeripheralOptionEnableAutoReconnect @discussion An NSNumber (Boolean) indicating that the AutoReconnect is enabled for the peripheral is connected. After peripheral device is connected, this will allow the system to initiate connect to the peer device automatically when link is dropped. Caller will get notified about the disconnection with potential delay via {@link centralManager:didDisconnectPeripheral:timestamp:isReconnecting:error:} @see connectPeripheral:

func CBConnectPeripheralOptionNotifyOnConnectionKey

func CBConnectPeripheralOptionNotifyOnConnectionKey() uintptr

@const CBConnectPeripheralOptionNotifyOnConnectionKey @discussion An NSNumber (Boolean) indicating that the system should display a connection alert for a given peripheral, if the application is suspended when a successful connection is made. This is useful for applications that have not specified the <code>bluetooth-central</code> background mode and cannot display their own alert. If more than one application has requested notification for a given peripheral, the one that was most recently in the foreground will receive the alert. @see connectPeripheral:

func CBConnectPeripheralOptionNotifyOnDisconnectionKey

func CBConnectPeripheralOptionNotifyOnDisconnectionKey() uintptr

@const CBConnectPeripheralOptionNotifyOnDisconnectionKey @discussion An NSNumber (Boolean) indicating that the system should display a disconnection alert for a given peripheral, if the application is suspended at the time of the disconnection. This is useful for applications that have not specified the <code>bluetooth-central</code> background mode and cannot display their own alert. If more than one application has requested notification for a given peripheral, the one that was most recently in the foreground will receive the alert. @see connectPeripheral:

func CBConnectPeripheralOptionNotifyOnNotificationKey

func CBConnectPeripheralOptionNotifyOnNotificationKey() uintptr

@const CBConnectPeripheralOptionNotifyOnNotificationKey @discussion An NSNumber (Boolean) indicating that the system should display an alert for all notifications received from a given peripheral, if the application is suspended at the time. This is useful for applications that have not specified the <code>bluetooth-central</code> background mode and cannot display their own alert. If more than one application has requested notification for a given peripheral, the one that was most recently in the foreground will receive the alert. @see connectPeripheral:

func CBConnectPeripheralOptionStartDelayKey

func CBConnectPeripheralOptionStartDelayKey() uintptr

@const CBConnectPeripheralOptionStartDelayKey @discussion An NSNumber indicating the number of seconds for the system to wait before starting a connection. @see connectPeripheral:

func CBErrorDomain

func CBErrorDomain() uintptr

func CBPeripheralManagerOptionRestoreIdentifierKey

func CBPeripheralManagerOptionRestoreIdentifierKey() uintptr

@const CBPeripheralManagerOptionRestoreIdentifierKey @discussion An NSString containing a unique identifier (UID) for the <code>CBPeripheralManager</code> that is being instantiated. This UID is used by the system to identify a specific <code>CBPeripheralManager</code> instance for restoration and, therefore, must remain the same for subsequent application executions in order for the manager to be restored. @see initWithDelegate:queue:options: @seealso centralManager:willRestoreState:

func CBPeripheralManagerOptionShowPowerAlertKey

func CBPeripheralManagerOptionShowPowerAlertKey() uintptr

@const CBPeripheralManagerOptionShowPowerAlertKey @discussion An NSNumber (Boolean) indicating that the system should, if Bluetooth is powered off when <code>CBPeripheralManager</code> is instantiated, display a warning dialog to the user. @see initWithDelegate:queue:options:

func CBPeripheralManagerRestoredStateAdvertisementDataKey

func CBPeripheralManagerRestoredStateAdvertisementDataKey() uintptr

@const CBPeripheralManagerRestoredStateAdvertisementDataKey @discussion An NSDictionary containing the data being advertised at the time the application was terminated by the system. @see peripheralManager:willRestoreState: @seealso startAdvertising:

func CBPeripheralManagerRestoredStateServicesKey

func CBPeripheralManagerRestoredStateServicesKey() uintptr

@const CBPeripheralManagerRestoredStateServicesKey @discussion An NSArray of <code>CBMutableService</code> objects containing all services that were published to the local database at the time the application was terminated by the system. All information for each service will be restored, including all discovered services, characteristics and descriptors, as well as characteristic notification states. @see peripheralManager:willRestoreState: @seealso addService:

func CBUUIDCharacteristicAggregateFormatString

func CBUUIDCharacteristicAggregateFormatString() uintptr

@const CBUUIDCharacteristicAggregateFormatString @discussion The string representation of the UUID for the aggregate descriptor.

func CBUUIDCharacteristicExtendedPropertiesString

func CBUUIDCharacteristicExtendedPropertiesString() uintptr

@const CBUUIDCharacteristicExtendedPropertiesString @discussion The string representation of the UUID for the extended properties descriptor. The corresponding value for this descriptor is an <code>NSNumber</code> object.

func CBUUIDCharacteristicFormatString

func CBUUIDCharacteristicFormatString() uintptr

@const CBUUIDCharacteristicFormatString @discussion The string representation of the UUID for the presentation format descriptor. The corresponding value for this descriptor is an <code>NSData</code> object.

func CBUUIDCharacteristicObservationScheduleString

func CBUUIDCharacteristicObservationScheduleString() uintptr

@const CBUUIDCharacteristicObservationScheduleString @discussion Data representing the observation schedule for a characteristic.

func CBUUIDCharacteristicUserDescriptionString

func CBUUIDCharacteristicUserDescriptionString() uintptr

@const CBUUIDCharacteristicUserDescriptionString @discussion The string representation of the UUID for the user description descriptor. The corresponding value for this descriptor is an <code>NSString</code> object.

func CBUUIDCharacteristicValidRangeString

func CBUUIDCharacteristicValidRangeString() uintptr

@const CBUUIDCharacteristicValidRangeString @discussion Data representing the valid min/max values accepted for a characteristic.

func CBUUIDClientCharacteristicConfigurationString

func CBUUIDClientCharacteristicConfigurationString() uintptr

@const CBUUIDClientCharacteristicConfigurationString @discussion The string representation of the UUID for the client configuration descriptor. The corresponding value for this descriptor is an <code>NSNumber</code> object.

func CBUUIDL2CAPPSMCharacteristicString

func CBUUIDL2CAPPSMCharacteristicString() uintptr

@const CBUUIDL2CAPPSMCharacteristicString @discussion The PSM (a little endian uint16_t) of an L2CAP Channel associated with the GATT service containing this characteristic. Servers can publish this characteristic with the UUID ABDD3056-28FA-441D-A470-55A75A52553A

func CBUUIDServerCharacteristicConfigurationString

func CBUUIDServerCharacteristicConfigurationString() uintptr

@const CBUUIDServerCharacteristicConfigurationString @discussion The string representation of the UUID for the server configuration descriptor. The corresponding value for this descriptor is an <code>NSNumber</code> object.

Types

type Acl_entry_id_t

type Acl_entry_id_t int64
const (
	ACL_FIRST_ENTRY Acl_entry_id_t = 0
	ACL_NEXT_ENTRY  Acl_entry_id_t = -1
	ACL_LAST_ENTRY  Acl_entry_id_t = -2
)

func (Acl_entry_id_t) String

func (e Acl_entry_id_t) String() string

type Acl_flag_t

type Acl_flag_t int64
const (
	ACL_FLAG_DEFER_INHERIT      Acl_flag_t = 1
	ACL_FLAG_NO_INHERIT         Acl_flag_t = 131072
	ACL_ENTRY_INHERITED         Acl_flag_t = 16
	ACL_ENTRY_FILE_INHERIT      Acl_flag_t = 32
	ACL_ENTRY_DIRECTORY_INHERIT Acl_flag_t = 64
	ACL_ENTRY_LIMIT_INHERIT     Acl_flag_t = 128
	ACL_ENTRY_ONLY_INHERIT      Acl_flag_t = 256
)

func (Acl_flag_t) String

func (e Acl_flag_t) String() string

type Acl_perm_t

type Acl_perm_t int64
const (
	ACL_READ_DATA           Acl_perm_t = 2
	ACL_LIST_DIRECTORY      Acl_perm_t = 2
	ACL_WRITE_DATA          Acl_perm_t = 4
	ACL_ADD_FILE            Acl_perm_t = 4
	ACL_EXECUTE             Acl_perm_t = 8
	ACL_SEARCH              Acl_perm_t = 8
	ACL_DELETE              Acl_perm_t = 16
	ACL_APPEND_DATA         Acl_perm_t = 32
	ACL_ADD_SUBDIRECTORY    Acl_perm_t = 32
	ACL_DELETE_CHILD        Acl_perm_t = 64
	ACL_READ_ATTRIBUTES     Acl_perm_t = 128
	ACL_WRITE_ATTRIBUTES    Acl_perm_t = 256
	ACL_READ_EXTATTRIBUTES  Acl_perm_t = 512
	ACL_WRITE_EXTATTRIBUTES Acl_perm_t = 1024
	ACL_READ_SECURITY       Acl_perm_t = 2048
	ACL_WRITE_SECURITY      Acl_perm_t = 4096
	ACL_CHANGE_OWNER        Acl_perm_t = 8192
	ACL_SYNCHRONIZE         Acl_perm_t = 1048576
)

func (Acl_perm_t) String

func (e Acl_perm_t) String() string

type Acl_tag_t

type Acl_tag_t int64
const (
	ACL_UNDEFINED_TAG  Acl_tag_t = 0
	ACL_EXTENDED_ALLOW Acl_tag_t = 1
	ACL_EXTENDED_DENY  Acl_tag_t = 2
)

func (Acl_tag_t) String

func (e Acl_tag_t) String() string

type Acl_type_t

type Acl_type_t int64
const (
	ACL_TYPE_EXTENDED Acl_type_t = 256
	ACL_TYPE_ACCESS   Acl_type_t = 0
	ACL_TYPE_DEFAULT  Acl_type_t = 1
	ACL_TYPE_AFS      Acl_type_t = 2
	ACL_TYPE_CODA     Acl_type_t = 3
	ACL_TYPE_NTFS     Acl_type_t = 4
	ACL_TYPE_NWFS     Acl_type_t = 5
)

func (Acl_type_t) String

func (e Acl_type_t) String() string

type CBATTError

type CBATTError int64

An error that Core Bluetooth returns while using Attribute Protocol (ATT).

const (
	CBATTErrorSuccess                       CBATTError = 0
	CBATTErrorInvalidHandle                 CBATTError = 1
	CBATTErrorReadNotPermitted              CBATTError = 2
	CBATTErrorWriteNotPermitted             CBATTError = 3
	CBATTErrorInvalidPdu                    CBATTError = 4
	CBATTErrorInsufficientAuthentication    CBATTError = 5
	CBATTErrorRequestNotSupported           CBATTError = 6
	CBATTErrorInvalidOffset                 CBATTError = 7
	CBATTErrorInsufficientAuthorization     CBATTError = 8
	CBATTErrorPrepareQueueFull              CBATTError = 9
	CBATTErrorAttributeNotFound             CBATTError = 10
	CBATTErrorAttributeNotLong              CBATTError = 11
	CBATTErrorInsufficientEncryptionKeySize CBATTError = 12
	CBATTErrorInvalidAttributeValueLength   CBATTError = 13
	CBATTErrorUnlikelyError                 CBATTError = 14
	CBATTErrorInsufficientEncryption        CBATTError = 15
	CBATTErrorUnsupportedGroupType          CBATTError = 16
	CBATTErrorInsufficientResources         CBATTError = 17
)

func (CBATTError) String

func (e CBATTError) String() string

type CBATTRequest

type CBATTRequest struct {
	foundation.NSObject
}

A request that uses the Attribute Protocol (ATT).

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbattrequest

func CBATTRequestFromID

func CBATTRequestFromID(id objc.ID) *CBATTRequest

func (*CBATTRequest) Central

func (o *CBATTRequest) Central() *CBCentral

@property central @discussion The central that originated the request.

func (*CBATTRequest) Characteristic

func (o *CBATTRequest) Characteristic() *CBCharacteristic

@property characteristic @discussion The characteristic whose value will be read or written.

func (*CBATTRequest) Offset

func (o *CBATTRequest) Offset() uint

@property offset @discussion The zero-based index of the first byte for the read or write.

func (*CBATTRequest) SetValue

func (o *CBATTRequest) SetValue(value *foundation.NSData)

func (*CBATTRequest) Value

func (o *CBATTRequest) Value() *foundation.NSData

@property value @discussion The data being read or written. For read requests, <i>value</i> will be nil and should be set before responding via @link respondToRequest:withResult: @/link. For write requests, <i>value</i> will contain the data to be written.

type CBAttribute

type CBAttribute struct {
	foundation.NSObject
}

A representation of common aspects of services offered by a peripheral.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbattribute

func CBAttributeFromID

func CBAttributeFromID(id objc.ID) *CBAttribute

func (*CBAttribute) UUID

func (o *CBAttribute) UUID() *CBUUID

type CBAttributePermissions

type CBAttributePermissions uint64

Values that represent the read, write, and encryption permissions for a characteristic’s value.

const (
	// A permission that indicates a peripheral can read the attribute’s value.
	CBAttributePermissionsReadable CBAttributePermissions = 1
	// A permission that indicates a peripheral can write the attribute’s value.
	CBAttributePermissionsWriteable CBAttributePermissions = 2
	// A permission that indicates only trusted devices can read the attribute’s value.
	CBAttributePermissionsReadEncryptionRequired CBAttributePermissions = 4
	// A permission that indicates only trusted devices can write the attribute’s value.
	CBAttributePermissionsWriteEncryptionRequired CBAttributePermissions = 8
)

func (CBAttributePermissions) String

func (e CBAttributePermissions) String() string

type CBCentral

type CBCentral struct {
	CBPeer
}

A remote device connected to a local app, which is acting as a peripheral.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbcentral

func CBCentralFromID

func CBCentralFromID(id objc.ID) *CBCentral

func (*CBCentral) MaximumUpdateValueLength

func (o *CBCentral) MaximumUpdateValueLength() uint

type CBCentralManager

type CBCentralManager struct {
	CBManager
}

An object that scans for, discovers, connects to, and manages peripherals.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbcentralmanager

func CBCentralManagerFromID

func CBCentralManagerFromID(id objc.ID) *CBCentralManager

func (*CBCentralManager) CancelPeripheralConnection

func (o *CBCentralManager) CancelPeripheralConnection(peripheral *CBPeripheral)

Cancels an active or pending local connection to a peripheral.

func (*CBCentralManager) ConnectPeripheralOptions

func (o *CBCentralManager) ConnectPeripheralOptions(peripheral *CBPeripheral, options *foundation.NSDictionary[*foundation.NSString, objc.ID])

Establishes a local connection to a peripheral.

func (*CBCentralManager) Delegate

@property delegate @discussion The delegate object that will receive central events.

func (*CBCentralManager) InitWithDelegateQueue

func (o *CBCentralManager) InitWithDelegateQueue(delegate CBCentralManagerDelegate, queue *foundation.NSObject) *CBCentralManager

Initializes the central manager with a specified delegate and dispatch queue.

func (*CBCentralManager) InitWithDelegateQueueOptions

func (o *CBCentralManager) InitWithDelegateQueueOptions(delegate CBCentralManagerDelegate, queue *foundation.NSObject, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) *CBCentralManager

Initializes the central manager with specified delegate, dispatch queue, and initialization options.

func (*CBCentralManager) IsScanning

func (o *CBCentralManager) IsScanning() bool

@property isScanning @discussion Whether or not the central is currently scanning.

func (*CBCentralManager) RetrieveConnectedPeripheralsWithServices

func (o *CBCentralManager) RetrieveConnectedPeripheralsWithServices(serviceUUIDs *foundation.NSArray[*CBUUID]) *foundation.NSArray[*CBPeripheral]

Returns a list of the peripherals connected to the system whose services match a given set of criteria.

func (*CBCentralManager) RetrievePeripheralsWithIdentifiers

func (o *CBCentralManager) RetrievePeripheralsWithIdentifiers(identifiers *foundation.NSArray[*foundation.NSUUID]) *foundation.NSArray[*CBPeripheral]

Returns a list of known peripherals by their identifiers.

func (*CBCentralManager) ScanForPeripheralsWithServicesOptions

func (o *CBCentralManager) ScanForPeripheralsWithServicesOptions(serviceUUIDs *foundation.NSArray[*CBUUID], options *foundation.NSDictionary[*foundation.NSString, objc.ID])

Scans for peripherals that are advertising services.

func (*CBCentralManager) SetDelegate

func (o *CBCentralManager) SetDelegate(delegate CBCentralManagerDelegate)

func (*CBCentralManager) StopScan

func (o *CBCentralManager) StopScan()

Asks the central manager to stop scanning for peripherals.

type CBCentralManagerDelegate

type CBCentralManagerDelegate interface {
	CentralManagerDidUpdateState(central *CBCentralManager)
}

CBCentralManagerDelegate wraps the ObjC protocol CBCentralManagerDelegate.

type CBCentralManagerFeature

type CBCentralManagerFeature uint64

An option set of device-specific features.

func (CBCentralManagerFeature) String

func (e CBCentralManagerFeature) String() string

type CBCentralManagerState

type CBCentralManagerState int64

Values that represent the current state of a central manager object. Deprecated: since macOS 10.13.

const (
	// The manager’s state is unknown.
	CBCentralManagerStateUnknown CBCentralManagerState = 0
	// A state that indicates the connection with the system service was momentarily lost.
	CBCentralManagerStateResetting CBCentralManagerState = 1
	// A state that indicates this device doesn’t support the Bluetooth low energy central or client role.
	CBCentralManagerStateUnsupported CBCentralManagerState = 2
	// A state that indicates the application isn’t authorized to use the Bluetooth low energy role.
	CBCentralManagerStateUnauthorized CBCentralManagerState = 3
	// A state that indicates Bluetooth is currently powered off.
	CBCentralManagerStatePoweredOff CBCentralManagerState = 4
	// A state that indicates Bluetooth is currently powered on and available to use.
	CBCentralManagerStatePoweredOn CBCentralManagerState = 5
)

func (CBCentralManagerState) String

func (e CBCentralManagerState) String() string

type CBCharacteristic

type CBCharacteristic struct {
	CBAttribute
}

A characteristic of a remote peripheral’s service.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbcharacteristic

func CBCharacteristicFromID

func CBCharacteristicFromID(id objc.ID) *CBCharacteristic

func (*CBCharacteristic) Descriptors

func (o *CBCharacteristic) Descriptors() *foundation.NSArray[*CBDescriptor]

@property descriptors @discussion A list of the CBDescriptors that have so far been discovered in this characteristic.

func (*CBCharacteristic) IsBroadcasted

func (o *CBCharacteristic) IsBroadcasted() bool

@property isBroadcasted @discussion Whether the characteristic is currently broadcasted or not. Deprecated: since macOS 10.13.

func (*CBCharacteristic) IsNotifying

func (o *CBCharacteristic) IsNotifying() bool

@property isNotifying @discussion Whether the characteristic is currently notifying or not.

func (*CBCharacteristic) Properties

@property properties @discussion The properties of the characteristic.

func (*CBCharacteristic) Service

func (o *CBCharacteristic) Service() *CBService

@property service @discussion A back-pointer to the service this characteristic belongs to.

func (*CBCharacteristic) Value

func (o *CBCharacteristic) Value() *foundation.NSData

@property value @discussion The value of the characteristic.

type CBCharacteristicProperties

type CBCharacteristicProperties uint64

Values that represent the possible properties of a characteristic.

const (
	// A property that indicates the characteristic can broadcast its value using a characteristic configuration descriptor.
	CBCharacteristicPropertyBroadcast CBCharacteristicProperties = 1
	// A property that indicates a peripheral can read the characteristic’s value.
	CBCharacteristicPropertyRead CBCharacteristicProperties = 2
	// A property that indicates a peripheral can write the characteristic’s value, without a response to indicate that the write succeeded.
	CBCharacteristicPropertyWriteWithoutResponse CBCharacteristicProperties = 4
	// A property that indicates a peripheral can write the characteristic’s value, with a response to indicate that the write succeeded.
	CBCharacteristicPropertyWrite CBCharacteristicProperties = 8
	// A property that indicates the peripheral permits notifications of the characteristic’s value, without a response from the central to indicate receipt of the notification.
	CBCharacteristicPropertyNotify CBCharacteristicProperties = 16
	// A property that indicates the peripheral permits notifications of the characteristic’s value, with a response from the central to indicate receipt of the notification.
	CBCharacteristicPropertyIndicate CBCharacteristicProperties = 32
	// A property that indicates the perhipheral allows signed writes of the characteristic’s value, without a response to indicate the write succeeded.
	CBCharacteristicPropertyAuthenticatedSignedWrites CBCharacteristicProperties = 64
	// A property that indicates the characteristic defines additional properties in the extended properties descriptor.
	CBCharacteristicPropertyExtendedProperties CBCharacteristicProperties = 128
	// A property that indicates that only trusted devices can enable notifications of the characteristic’s value.
	CBCharacteristicPropertyNotifyEncryptionRequired CBCharacteristicProperties = 256
	// A property that indicates only trusted devices can enable indications of the characteristic’s value.
	CBCharacteristicPropertyIndicateEncryptionRequired CBCharacteristicProperties = 512
)

func (CBCharacteristicProperties) String

type CBCharacteristicWriteType

type CBCharacteristicWriteType int64

Values representing the possible write types to a characteristic’s value.

const (
	// Write a characteristic value, with a response from the peripheral to indicate whether the write was successful.
	CBCharacteristicWriteWithResponse CBCharacteristicWriteType = 0
	// Write a characteristic value, without any response from the peripheral to indicate whether the write was successful.
	CBCharacteristicWriteWithoutResponse CBCharacteristicWriteType = 1
)

func (CBCharacteristicWriteType) String

func (e CBCharacteristicWriteType) String() string

type CBConnectionEvent

type CBConnectionEvent int64

A change to the connection state of a peer.

const (
	// The peer has disconnected from the local device.
	CBConnectionEventPeerDisconnected CBConnectionEvent = 0
	// The peer has connected to the local device.
	CBConnectionEventPeerConnected CBConnectionEvent = 1
)

func (CBConnectionEvent) String

func (e CBConnectionEvent) String() string

type CBDescriptor

type CBDescriptor struct {
	CBAttribute
}

An object that provides further information about a remote peripheral’s characteristic.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbdescriptor

func CBDescriptorFromID

func CBDescriptorFromID(id objc.ID) *CBDescriptor

func (*CBDescriptor) Characteristic

func (o *CBDescriptor) Characteristic() *CBCharacteristic

@property characteristic @discussion A back-pointer to the characteristic this descriptor belongs to.

func (*CBDescriptor) Value

func (o *CBDescriptor) Value() objc.ID

@property value @discussion The value of the descriptor. The corresponding value types for the various descriptors are detailed in @link CBUUID.h @/link.

type CBError

type CBError int64

An error that Core Bluetooth returns during Bluetooth transactions.

const (
	CBErrorUnknown                       CBError = 0
	CBErrorInvalidParameters             CBError = 1
	CBErrorInvalidHandle                 CBError = 2
	CBErrorNotConnected                  CBError = 3
	CBErrorOutOfSpace                    CBError = 4
	CBErrorOperationCancelled            CBError = 5
	CBErrorConnectionTimeout             CBError = 6
	CBErrorPeripheralDisconnected        CBError = 7
	CBErrorUUIDNotAllowed                CBError = 8
	CBErrorAlreadyAdvertising            CBError = 9
	CBErrorConnectionFailed              CBError = 10
	CBErrorConnectionLimitReached        CBError = 11
	CBErrorUnkownDevice                  CBError = 12
	CBErrorUnknownDevice                 CBError = 12
	CBErrorOperationNotSupported         CBError = 13
	CBErrorPeerRemovedPairingInformation CBError = 14
	CBErrorEncryptionTimedOut            CBError = 15
	CBErrorTooManyLEPairedDevices        CBError = 16
)

func (CBError) String

func (e CBError) String() string

type CBL2CAPChannel

type CBL2CAPChannel struct {
	foundation.NSObject
}

A live L2CAP connection to a remote device.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbl2capchannel

func CBL2CAPChannelFromID

func CBL2CAPChannelFromID(id objc.ID) *CBL2CAPChannel

func (*CBL2CAPChannel) InputStream

func (o *CBL2CAPChannel) InputStream() *foundation.NSInputStream

@property inputStream @discussion An NSStream used for reading data from the remote peer

func (*CBL2CAPChannel) OutputStream

func (o *CBL2CAPChannel) OutputStream() *foundation.NSOutputStream

@property outputStream @discussion An NSStream used for writing data to the peer

func (*CBL2CAPChannel) PSM

func (o *CBL2CAPChannel) PSM() uint16

@property PSM @discussion The PSM (Protocol/Service Multiplexer) of the channel

func (*CBL2CAPChannel) Peer

func (o *CBL2CAPChannel) Peer() *CBPeer

@property peer @discussion The peer connected to the channel

type CBManager

type CBManager struct {
	foundation.NSObject
}

The abstract base class that manages central and peripheral objects.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbmanager

func CBManagerFromID

func CBManagerFromID(id objc.ID) *CBManager

func (*CBManager) Authorization

func (o *CBManager) Authorization() CBManagerAuthorization

@property authorization @discussion The current authorization of the manager, initially set to <code>CBManagerAuthorizationNotDetermined</code>. Updates are provided by required delegate method {@link managerDidUpdateState:}. @seealso state

func (*CBManager) State

func (o *CBManager) State() CBManagerState

@property state @discussion The current state of the manager, initially set to <code>CBManagerStateUnknown</code>. Updates are provided by required delegate method {@link managerDidUpdateState:}.

type CBManagerAuthorization

type CBManagerAuthorization int64

The current authorization state of a Core Bluetooth manager.

const (
	// A state that indicates the user has yet to authorize Bluetooth for this app.
	CBManagerAuthorizationNotDetermined CBManagerAuthorization = 0
	// A state that indicates this app isn’t authorized to use Bluetooth.
	CBManagerAuthorizationRestricted CBManagerAuthorization = 1
	// A state that indicates the user explicitly denied Bluetooth access for this app.
	CBManagerAuthorizationDenied CBManagerAuthorization = 2
	// A state that indicates the user has authorized Bluetooth at any time.
	CBManagerAuthorizationAllowedAlways CBManagerAuthorization = 3
)

func CBManagerAuthorizationClass

func CBManagerAuthorizationClass() CBManagerAuthorization

@property authorization @discussion The current authorization of the manager, initially set to <code>CBManagerAuthorizationNotDetermined</code>. You can check this in your implementation of required delegate method {@link managerDidUpdateState:}. You can also use it to check authorization status before allocating CBManager. @seealso state

func (CBManagerAuthorization) String

func (e CBManagerAuthorization) String() string

type CBManagerState

type CBManagerState int64

The possible states of a Core Bluetooth manager.

const (
	// The manager’s state is unknown.
	CBManagerStateUnknown CBManagerState = 0
	// A state that indicates the connection with the system service was momentarily lost.
	CBManagerStateResetting CBManagerState = 1
	// A state that indicates this device doesn’t support the Bluetooth low energy central or client role.
	CBManagerStateUnsupported CBManagerState = 2
	// A state that indicates the application isn’t authorized to use the Bluetooth low energy role.
	CBManagerStateUnauthorized CBManagerState = 3
	// A state that indicates Bluetooth is currently powered off.
	CBManagerStatePoweredOff CBManagerState = 4
	// A state that indicates Bluetooth is currently powered on and available to use.
	CBManagerStatePoweredOn CBManagerState = 5
)

func (CBManagerState) String

func (e CBManagerState) String() string

type CBMutableCharacteristic

type CBMutableCharacteristic struct {
	CBCharacteristic
}

A characteristic of a local peripheral’s service.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbmutablecharacteristic

func CBMutableCharacteristicFromID

func CBMutableCharacteristicFromID(id objc.ID) *CBMutableCharacteristic

func (*CBMutableCharacteristic) InitWithTypePropertiesValuePermissions

func (o *CBMutableCharacteristic) InitWithTypePropertiesValuePermissions(uUID *CBUUID, properties CBCharacteristicProperties, value *foundation.NSData, permissions CBAttributePermissions) *CBMutableCharacteristic

Creates a mutable characteristic with specified permissions, properties, and value.

func (*CBMutableCharacteristic) Permissions

@property permissions @discussion The permissions of the characteristic value. @see CBAttributePermissions

func (*CBMutableCharacteristic) SetDescriptors

func (o *CBMutableCharacteristic) SetDescriptors(descriptors *foundation.NSArray[*CBDescriptor])

func (*CBMutableCharacteristic) SetPermissions

func (o *CBMutableCharacteristic) SetPermissions(permissions CBAttributePermissions)

func (*CBMutableCharacteristic) SetProperties

func (o *CBMutableCharacteristic) SetProperties(properties CBCharacteristicProperties)

func (*CBMutableCharacteristic) SetValue

func (o *CBMutableCharacteristic) SetValue(value *foundation.NSData)

func (*CBMutableCharacteristic) SubscribedCentrals

func (o *CBMutableCharacteristic) SubscribedCentrals() *foundation.NSArray[*CBCentral]

@property subscribedCentrals @discussion For notifying characteristics, the set of currently subscribed centrals.

type CBMutableDescriptor

type CBMutableDescriptor struct {
	CBDescriptor
}

An object that provides additional information about a local peripheral’s characteristic.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbmutabledescriptor

func CBMutableDescriptorFromID

func CBMutableDescriptorFromID(id objc.ID) *CBMutableDescriptor

func (*CBMutableDescriptor) InitWithTypeValue

func (o *CBMutableDescriptor) InitWithTypeValue(uUID *CBUUID, value objc.ID) *CBMutableDescriptor

Creates a mutable descriptor with a specified value.

type CBMutableService

type CBMutableService struct {
	CBService
}

A service with writeable property values.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbmutableservice

func CBMutableServiceFromID

func CBMutableServiceFromID(id objc.ID) *CBMutableService

func (*CBMutableService) InitWithTypePrimary

func (o *CBMutableService) InitWithTypePrimary(uUID *CBUUID, isPrimary bool) *CBMutableService

Creates a newly initialized mutable service specified by UUID and service type.

func (*CBMutableService) SetCharacteristics

func (o *CBMutableService) SetCharacteristics(characteristics *foundation.NSArray[*CBCharacteristic])

func (*CBMutableService) SetIncludedServices

func (o *CBMutableService) SetIncludedServices(includedServices *foundation.NSArray[*CBService])

type CBPeer

type CBPeer struct {
	foundation.NSObject
}

An object that represents a remote device.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbpeer

func CBPeerFromID

func CBPeerFromID(id objc.ID) *CBPeer

func (*CBPeer) Identifier

func (o *CBPeer) Identifier() *foundation.NSUUID

type CBPeripheral

type CBPeripheral struct {
	CBPeer
}

A remote peripheral device.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbperipheral

func CBPeripheralFromID

func CBPeripheralFromID(id objc.ID) *CBPeripheral

func (*CBPeripheral) CanSendWriteWithoutResponse

func (o *CBPeripheral) CanSendWriteWithoutResponse() bool

@property canSendWriteWithoutResponse @discussion YES if the remote device has space to send a write without response. If this value is NO, the value will be set to YES after the current writes have been flushed, and <link>peripheralIsReadyToSendWriteWithoutResponse:</link> will be called.

func (*CBPeripheral) Delegate

func (o *CBPeripheral) Delegate() CBPeripheralDelegate

@property delegate @discussion The delegate object that will receive peripheral events.

func (*CBPeripheral) DiscoverCharacteristicsForService

func (o *CBPeripheral) DiscoverCharacteristicsForService(characteristicUUIDs *foundation.NSArray[*CBUUID], service *CBService)

Discovers the specified characteristics of a service.

func (*CBPeripheral) DiscoverDescriptorsForCharacteristic

func (o *CBPeripheral) DiscoverDescriptorsForCharacteristic(characteristic *CBCharacteristic)

Discovers the descriptors of a characteristic.

func (*CBPeripheral) DiscoverIncludedServicesForService

func (o *CBPeripheral) DiscoverIncludedServicesForService(includedServiceUUIDs *foundation.NSArray[*CBUUID], service *CBService)

Discovers the specified included services of a previously-discovered service.

func (*CBPeripheral) DiscoverServices

func (o *CBPeripheral) DiscoverServices(serviceUUIDs *foundation.NSArray[*CBUUID])

Discovers the specified services of the peripheral.

func (*CBPeripheral) MaximumWriteValueLengthForType

func (o *CBPeripheral) MaximumWriteValueLengthForType(type_ CBCharacteristicWriteType) uint

The maximum amount of data, in bytes, you can send to a characteristic in a single write type.

func (*CBPeripheral) Name

func (o *CBPeripheral) Name() *foundation.NSString

@property name @discussion The name of the peripheral.

func (*CBPeripheral) OpenL2CAPChannel

func (o *CBPeripheral) OpenL2CAPChannel(pSM uint16)

Attempts to open an L2CAP channel to the peripheral using the supplied Protocol/Service Multiplexer (PSM).

func (*CBPeripheral) RSSI

func (o *CBPeripheral) RSSI() *foundation.NSNumber

@property RSSI @discussion The most recently read RSSI, in decibels. @deprecated Use {@link peripheral:didReadRSSI:error:} instead. Deprecated: since macOS 10.13.

func (*CBPeripheral) ReadRSSI

func (o *CBPeripheral) ReadRSSI()

Retrieves the current RSSI value for the peripheral while connected to the central manager.

func (*CBPeripheral) ReadValueForCharacteristic

func (o *CBPeripheral) ReadValueForCharacteristic(characteristic *CBCharacteristic)

Retrieves the value of a specified characteristic.

func (*CBPeripheral) ReadValueForDescriptor

func (o *CBPeripheral) ReadValueForDescriptor(descriptor *CBDescriptor)

Retrieves the value of a specified characteristic descriptor.

func (*CBPeripheral) Services

func (o *CBPeripheral) Services() *foundation.NSArray[*CBService]

@property services @discussion A list of <code>CBService</code> objects that have been discovered on the peripheral.

func (*CBPeripheral) SetDelegate

func (o *CBPeripheral) SetDelegate(delegate CBPeripheralDelegate)

func (*CBPeripheral) SetNotifyValueForCharacteristic

func (o *CBPeripheral) SetNotifyValueForCharacteristic(enabled bool, characteristic *CBCharacteristic)

Sets notifications or indications for the value of a specified characteristic.

func (*CBPeripheral) State

func (o *CBPeripheral) State() CBPeripheralState

@property state @discussion The current connection state of the peripheral.

func (*CBPeripheral) WriteValueForCharacteristicType

func (o *CBPeripheral) WriteValueForCharacteristicType(data *foundation.NSData, characteristic *CBCharacteristic, type_ CBCharacteristicWriteType)

Writes the value of a characteristic.

func (*CBPeripheral) WriteValueForDescriptor

func (o *CBPeripheral) WriteValueForDescriptor(data *foundation.NSData, descriptor *CBDescriptor)

Writes the value of a characteristic descriptor.

type CBPeripheralDelegate

type CBPeripheralDelegate interface {
}

CBPeripheralDelegate wraps the ObjC protocol CBPeripheralDelegate.

type CBPeripheralManager

type CBPeripheralManager struct {
	CBManager
}

An object that manages and advertises peripheral services exposed by this app.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbperipheralmanager

func CBPeripheralManagerFromID

func CBPeripheralManagerFromID(id objc.ID) *CBPeripheralManager

func (*CBPeripheralManager) AddService

func (o *CBPeripheralManager) AddService(service *CBMutableService)

Publishes a service and any of its associated characteristics and characteristic descriptors to the local GATT database.

func (*CBPeripheralManager) Delegate

@property delegate @discussion The delegate object that will receive peripheral events.

func (*CBPeripheralManager) Init

Initializes the peripheral manager without a delegate. Deprecated: since macOS 10.15.

func (*CBPeripheralManager) InitWithDelegateQueue

func (o *CBPeripheralManager) InitWithDelegateQueue(delegate CBPeripheralManagerDelegate, queue *foundation.NSObject) *CBPeripheralManager

Initializes the peripheral manager with a specified delegate and dispatch queue.

func (*CBPeripheralManager) InitWithDelegateQueueOptions

Initializes the peripheral manager with a specified delegate, dispatch queue, and initialization options.

func (*CBPeripheralManager) IsAdvertising

func (o *CBPeripheralManager) IsAdvertising() bool

@property isAdvertising @discussion Whether or not the peripheral is currently advertising data.

func (*CBPeripheralManager) PublishL2CAPChannelWithEncryption

func (o *CBPeripheralManager) PublishL2CAPChannelWithEncryption(encryptionRequired bool)

Creates a listener for incoming L2CAP channel connections.

func (*CBPeripheralManager) RemoveAllServices

func (o *CBPeripheralManager) RemoveAllServices()

Removes all published services from the local GATT database.

func (*CBPeripheralManager) RemoveService

func (o *CBPeripheralManager) RemoveService(service *CBMutableService)

Removes a specified published service from the local GATT database.

func (*CBPeripheralManager) RespondToRequestWithResult

func (o *CBPeripheralManager) RespondToRequestWithResult(request *CBATTRequest, result CBATTError)

Responds to a read or write request from a connected central.

func (*CBPeripheralManager) SetDelegate

func (o *CBPeripheralManager) SetDelegate(delegate CBPeripheralManagerDelegate)

func (*CBPeripheralManager) SetDesiredConnectionLatencyForCentral

func (o *CBPeripheralManager) SetDesiredConnectionLatencyForCentral(latency CBPeripheralManagerConnectionLatency, central *CBCentral)

Sets the desired connection latency for an existing connection to a central device.

func (*CBPeripheralManager) StartAdvertising

func (o *CBPeripheralManager) StartAdvertising(advertisementData *foundation.NSDictionary[*foundation.NSString, objc.ID])

Advertises peripheral manager data.

func (*CBPeripheralManager) StopAdvertising

func (o *CBPeripheralManager) StopAdvertising()

Stops advertising peripheral manager data.

func (*CBPeripheralManager) UnpublishL2CAPChannel

func (o *CBPeripheralManager) UnpublishL2CAPChannel(pSM uint16)

Removes a published service from the local system.

func (*CBPeripheralManager) UpdateValueForCharacteristicOnSubscribedCentrals

func (o *CBPeripheralManager) UpdateValueForCharacteristicOnSubscribedCentrals(value *foundation.NSData, characteristic *CBMutableCharacteristic, centrals *foundation.NSArray[*CBCentral]) bool

Send an updated characteristic value to one or more subscribed centrals, using a notification or indication.

type CBPeripheralManagerAuthorizationStatus

type CBPeripheralManagerAuthorizationStatus int64

Values representing the current authorization state of the peripheral manager. Deprecated: since macOS 10.15.

const (
	// An authorization status that indicates the user hasn’t indicated whether this app can share data using Bluetooth while in the background.
	CBPeripheralManagerAuthorizationStatusNotDetermined CBPeripheralManagerAuthorizationStatus = 0
	// An authorization status that indicates this app isn’t authorized to share data using Bluetooth while in the background.
	CBPeripheralManagerAuthorizationStatusRestricted CBPeripheralManagerAuthorizationStatus = 1
	// An authorization status that indicates the user explicitly denied this app from sharing data using Bluetooth while in the background.
	CBPeripheralManagerAuthorizationStatusDenied CBPeripheralManagerAuthorizationStatus = 2
	// An authorization status that indicates the user authorized this app to share data using Bluetooth while in the background.
	CBPeripheralManagerAuthorizationStatusAuthorized CBPeripheralManagerAuthorizationStatus = 3
)

func CBPeripheralManagerAuthorizationStatusClass

func CBPeripheralManagerAuthorizationStatusClass() CBPeripheralManagerAuthorizationStatus

Returns the app’s authorization status for sharing data while in the background. Deprecated: since macOS 10.15.

func (CBPeripheralManagerAuthorizationStatus) String

type CBPeripheralManagerConnectionLatency

type CBPeripheralManagerConnectionLatency int64

Values representing the connection latency of the peripheral manager.

const (
	// A latency setting indicating that prioritizes rapid communication over battery life.
	CBPeripheralManagerConnectionLatencyLow CBPeripheralManagerConnectionLatency = 0
	// A latency setting that balances communication frequency and battery life.
	CBPeripheralManagerConnectionLatencyMedium CBPeripheralManagerConnectionLatency = 1
	// A latency setting that prioritizes extending battery life over rapid communication.
	CBPeripheralManagerConnectionLatencyHigh CBPeripheralManagerConnectionLatency = 2
)

func (CBPeripheralManagerConnectionLatency) String

type CBPeripheralManagerDelegate

type CBPeripheralManagerDelegate interface {
	PeripheralManagerDidUpdateState(peripheral *CBPeripheralManager)
}

CBPeripheralManagerDelegate wraps the ObjC protocol CBPeripheralManagerDelegate.

type CBPeripheralManagerState

type CBPeripheralManagerState int64

Values that represent the current state of the peripheral manager. Deprecated: since macOS 10.13.

const (
	// A manager state that indicates the current state of the peripheral manager is unknown.
	CBPeripheralManagerStateUnknown CBPeripheralManagerState = 0
	// A manager state that indicates the connection with the system service was momentarily lost.
	CBPeripheralManagerStateResetting CBPeripheralManagerState = 1
	// A manager state that indicates the platform doesn’t support the Bluetooth low energy peripheral/server role.
	CBPeripheralManagerStateUnsupported CBPeripheralManagerState = 2
	// A manager state that indicates the app isn’t authorized to use the Bluetooth low energy peripheral/server role.
	CBPeripheralManagerStateUnauthorized CBPeripheralManagerState = 3
	// A manager state that indicates Bluetooth is currently powered off.
	CBPeripheralManagerStatePoweredOff CBPeripheralManagerState = 4
	// A manager state that indicates Bluetooth is currently powered on and is available to use.
	CBPeripheralManagerStatePoweredOn CBPeripheralManagerState = 5
)

func (CBPeripheralManagerState) String

func (e CBPeripheralManagerState) String() string

type CBPeripheralState

type CBPeripheralState int64

Values representing the connection state of a peripheral.

const (
	// The peripheral isn’t connected to the central manager.
	CBPeripheralStateDisconnected CBPeripheralState = 0
	// The peripheral is in the process of connecting to the central manager.
	CBPeripheralStateConnecting CBPeripheralState = 1
	// The peripheral is connected to the central manager.
	CBPeripheralStateConnected CBPeripheralState = 2
	// The peripheral is disconnecting from the central manager.
	CBPeripheralStateDisconnecting CBPeripheralState = 3
)

func (CBPeripheralState) String

func (e CBPeripheralState) String() string

type CBService

type CBService struct {
	CBAttribute
}

A collection of data and associated behaviors that accomplish a function or feature of a device.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbservice

func CBServiceFromID

func CBServiceFromID(id objc.ID) *CBService

func (*CBService) Characteristics

func (o *CBService) Characteristics() *foundation.NSArray[*CBCharacteristic]

@property characteristics @discussion A list of CBCharacteristics that have so far been discovered in this service.

func (*CBService) IncludedServices

func (o *CBService) IncludedServices() *foundation.NSArray[*CBService]

@property includedServices @discussion A list of included CBServices that have so far been discovered in this service.

func (*CBService) IsPrimary

func (o *CBService) IsPrimary() bool

@property isPrimary @discussion The type of the service (primary or secondary).

func (*CBService) Peripheral

func (o *CBService) Peripheral() *CBPeripheral

@property peripheral @discussion A back-pointer to the peripheral this service belongs to.

type CBUUID

type CBUUID struct {
	foundation.NSObject
}

A universally unique identifier, as defined by Bluetooth standards.

Apple documentation: https://developer.apple.com/documentation/corebluetooth/cbuuid

func CBUUIDFromID

func CBUUIDFromID(id objc.ID) *CBUUID

func CBUUIDUUIDWithCFUUID

func CBUUIDUUIDWithCFUUID(theUUID unsafe.Pointer) *CBUUID

Creates a Core Bluetooth UUID object from a Core Foundation UUID object. Deprecated: since macOS 10.13.

func CBUUIDUUIDWithData

func CBUUIDUUIDWithData(theData *foundation.NSData) *CBUUID

Creates a Core Bluetooth UUID object from a 16-, 32-, or 128-bit UUID data container.

func CBUUIDUUIDWithNSUUID

func CBUUIDUUIDWithNSUUID(theUUID *foundation.NSUUID) *CBUUID

Creates a Core Bluetooth UUID object from a Foundation UUID object.

func CBUUIDUUIDWithString

func CBUUIDUUIDWithString(theString *foundation.NSString) *CBUUID

Creates a Core Bluetooth UUID object from a 16-, 32-, or 128-bit UUID string.

func (*CBUUID) Data

func (o *CBUUID) Data() *foundation.NSData

@property data @discussion The UUID as NSData.

func (*CBUUID) UUIDString

func (o *CBUUID) UUIDString() *foundation.NSString

@property UUIDString @discussion The UUID as NSString.

type Clockid_t

type Clockid_t int64

func (Clockid_t) String

func (e Clockid_t) String() string

type Dispatch_autorelease_frequency_t

type Dispatch_autorelease_frequency_t uint64
const (
	DISPATCH_AUTORELEASE_FREQUENCY_INHERIT   Dispatch_autorelease_frequency_t = 0
	DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM Dispatch_autorelease_frequency_t = 1
	DISPATCH_AUTORELEASE_FREQUENCY_NEVER     Dispatch_autorelease_frequency_t = 2
)

func (Dispatch_autorelease_frequency_t) String

type Dispatch_block_flags_t

type Dispatch_block_flags_t uint64
const (
	DISPATCH_BLOCK_BARRIER           Dispatch_block_flags_t = 1
	DISPATCH_BLOCK_DETACHED          Dispatch_block_flags_t = 2
	DISPATCH_BLOCK_ASSIGN_CURRENT    Dispatch_block_flags_t = 4
	DISPATCH_BLOCK_NO_QOS_CLASS      Dispatch_block_flags_t = 8
	DISPATCH_BLOCK_INHERIT_QOS_CLASS Dispatch_block_flags_t = 16
	DISPATCH_BLOCK_ENFORCE_QOS_CLASS Dispatch_block_flags_t = 32
)

func (Dispatch_block_flags_t) String

func (e Dispatch_block_flags_t) String() string

type Filesec_property_t

type Filesec_property_t int64
const (
	FILESEC_OWNER         Filesec_property_t = 1
	FILESEC_GROUP         Filesec_property_t = 2
	FILESEC_UUID          Filesec_property_t = 3
	FILESEC_MODE          Filesec_property_t = 4
	FILESEC_ACL           Filesec_property_t = 5
	FILESEC_GRPUUID       Filesec_property_t = 6
	FILESEC_ACL_RAW       Filesec_property_t = 100
	FILESEC_ACL_ALLOCSIZE Filesec_property_t = 101
)

func (Filesec_property_t) String

func (e Filesec_property_t) String() string

type Idtype_t

type Idtype_t int64
const (
	P_ALL  Idtype_t = 0
	P_PID  Idtype_t = 1
	P_PGID Idtype_t = 2
)

func (Idtype_t) String

func (e Idtype_t) String() string

type Ipc_info_object_type_t

type Ipc_info_object_type_t int64
const (
	IPC_OTYPE_NONE                 Ipc_info_object_type_t = 0
	IPC_OTYPE_THREAD_CONTROL       Ipc_info_object_type_t = 1
	IPC_OTYPE_TASK_CONTROL         Ipc_info_object_type_t = 2
	IPC_OTYPE_HOST                 Ipc_info_object_type_t = 3
	IPC_OTYPE_HOST_PRIV            Ipc_info_object_type_t = 4
	IPC_OTYPE_PROCESSOR            Ipc_info_object_type_t = 5
	IPC_OTYPE_PROCESSOR_SET        Ipc_info_object_type_t = 6
	IPC_OTYPE_PROCESSOR_SET_NAME   Ipc_info_object_type_t = 7
	IPC_OTYPE_TIMER                Ipc_info_object_type_t = 8
	IPC_OTYPE_PORT_SUBST_ONCE      Ipc_info_object_type_t = 9
	IPC_OTYPE_MIG                  Ipc_info_object_type_t = 10
	IPC_OTYPE_MEMORY_OBJECT        Ipc_info_object_type_t = 11
	IPC_OTYPE_XMM_PAGER            Ipc_info_object_type_t = 12
	IPC_OTYPE_XMM_KERNEL           Ipc_info_object_type_t = 13
	IPC_OTYPE_XMM_REPLY            Ipc_info_object_type_t = 14
	IPC_OTYPE_UND_REPLY            Ipc_info_object_type_t = 15
	IPC_OTYPE_HOST_NOTIFY          Ipc_info_object_type_t = 16
	IPC_OTYPE_HOST_SECURITY        Ipc_info_object_type_t = 17
	IPC_OTYPE_LEDGER               Ipc_info_object_type_t = 18
	IPC_OTYPE_MAIN_DEVICE          Ipc_info_object_type_t = 19
	IPC_OTYPE_TASK_NAME            Ipc_info_object_type_t = 20
	IPC_OTYPE_SUBSYSTEM            Ipc_info_object_type_t = 21
	IPC_OTYPE_IO_DONE_QUEUE        Ipc_info_object_type_t = 22
	IPC_OTYPE_SEMAPHORE            Ipc_info_object_type_t = 23
	IPC_OTYPE_LOCK_SET             Ipc_info_object_type_t = 24
	IPC_OTYPE_CLOCK                Ipc_info_object_type_t = 25
	IPC_OTYPE_CLOCK_CTRL           Ipc_info_object_type_t = 26
	IPC_OTYPE_IOKIT_IDENT          Ipc_info_object_type_t = 27
	IPC_OTYPE_NAMED_ENTRY          Ipc_info_object_type_t = 28
	IPC_OTYPE_IOKIT_CONNECT        Ipc_info_object_type_t = 29
	IPC_OTYPE_IOKIT_OBJECT         Ipc_info_object_type_t = 30
	IPC_OTYPE_UPL                  Ipc_info_object_type_t = 31
	IPC_OTYPE_MEM_OBJ_CONTROL      Ipc_info_object_type_t = 32
	IPC_OTYPE_AU_SESSIONPORT       Ipc_info_object_type_t = 33
	IPC_OTYPE_FILEPORT             Ipc_info_object_type_t = 34
	IPC_OTYPE_LABELH               Ipc_info_object_type_t = 35
	IPC_OTYPE_TASK_RESUME          Ipc_info_object_type_t = 36
	IPC_OTYPE_VOUCHER              Ipc_info_object_type_t = 37
	IPC_OTYPE_VOUCHER_ATTR_CONTROL Ipc_info_object_type_t = 38
	IPC_OTYPE_WORK_INTERVAL        Ipc_info_object_type_t = 39
	IPC_OTYPE_UX_HANDLER           Ipc_info_object_type_t = 40
	IPC_OTYPE_UEXT_OBJECT          Ipc_info_object_type_t = 41
	IPC_OTYPE_ARCADE_REG           Ipc_info_object_type_t = 42
	IPC_OTYPE_EVENTLINK            Ipc_info_object_type_t = 43
	IPC_OTYPE_TASK_INSPECT         Ipc_info_object_type_t = 44
	IPC_OTYPE_TASK_READ            Ipc_info_object_type_t = 45
	IPC_OTYPE_THREAD_INSPECT       Ipc_info_object_type_t = 46
	IPC_OTYPE_THREAD_READ          Ipc_info_object_type_t = 47
	IPC_OTYPE_SUID_CRED            Ipc_info_object_type_t = 48
	IPC_OTYPE_HYPERVISOR           Ipc_info_object_type_t = 49
	IPC_OTYPE_TASK_ID_TOKEN        Ipc_info_object_type_t = 50
	IPC_OTYPE_TASK_FATAL           Ipc_info_object_type_t = 51
	IPC_OTYPE_KCDATA               Ipc_info_object_type_t = 52
	IPC_OTYPE_EXCLAVES_RESOURCE    Ipc_info_object_type_t = 53
	IPC_OTYPE_THREAD_RESUME        Ipc_info_object_type_t = 54
	IPC_OTYPE_UNKNOWN              Ipc_info_object_type_t = 4294967295
)

func (Ipc_info_object_type_t) String

func (e Ipc_info_object_type_t) String() string

type Launch_data_type_t

type Launch_data_type_t int64
const (
	LAUNCH_DATA_DICTIONARY Launch_data_type_t = 1
	LAUNCH_DATA_ARRAY      Launch_data_type_t = 2
	LAUNCH_DATA_FD         Launch_data_type_t = 3
	LAUNCH_DATA_INTEGER    Launch_data_type_t = 4
	LAUNCH_DATA_REAL       Launch_data_type_t = 5
	LAUNCH_DATA_BOOL       Launch_data_type_t = 6
	LAUNCH_DATA_STRING     Launch_data_type_t = 7
	LAUNCH_DATA_OPAQUE     Launch_data_type_t = 8
	LAUNCH_DATA_ERRNO      Launch_data_type_t = 9
	LAUNCH_DATA_MACHPORT   Launch_data_type_t = 10
)

func (Launch_data_type_t) String

func (e Launch_data_type_t) String() string

type MDLabelDomain

type MDLabelDomain int64

@typedef MDLabelDomain @abstract These constants are used to specify a domain to MDLabelCreate().

const (
	KMDLabelUserDomain  MDLabelDomain = 0
	KMDLabelLocalDomain MDLabelDomain = 1
)

func (MDLabelDomain) String

func (e MDLabelDomain) String() string

type MDQueryOptionFlags

type MDQueryOptionFlags int64
const (
	KMDQuerySynchronous        MDQueryOptionFlags = 1
	KMDQueryWantsUpdates       MDQueryOptionFlags = 4
	KMDQueryAllowFSTranslation MDQueryOptionFlags = 8
)

func (MDQueryOptionFlags) String

func (e MDQueryOptionFlags) String() string

type MDQuerySortOptionFlags

type MDQuerySortOptionFlags int64

@enum MDQuerySortOptionFlags @constant kMDQueryReverseSortOrderFlag Sort the attribute in reverse order.

const (
	KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)

func (MDQuerySortOptionFlags) String

func (e MDQuerySortOptionFlags) String() string

type Mach_vm_range_flags_t

type Mach_vm_range_flags_t int64
const (
	MACH_VM_RANGE_NONE Mach_vm_range_flags_t = 0
)

func (Mach_vm_range_flags_t) String

func (e Mach_vm_range_flags_t) String() string

type Mach_vm_range_flavor_t

type Mach_vm_range_flavor_t int64
const (
	MACH_VM_RANGE_FLAVOR_INVALID Mach_vm_range_flavor_t = 0
	MACH_VM_RANGE_FLAVOR_V1      Mach_vm_range_flavor_t = 1
)

func (Mach_vm_range_flavor_t) String

func (e Mach_vm_range_flavor_t) String() string

type Mach_vm_range_tag_t

type Mach_vm_range_tag_t int64
const (
	MACH_VM_RANGE_DEFAULT Mach_vm_range_tag_t = 0
	MACH_VM_RANGE_DATA    Mach_vm_range_tag_t = 1
	MACH_VM_RANGE_FIXED   Mach_vm_range_tag_t = 2
)

func (Mach_vm_range_tag_t) String

func (e Mach_vm_range_tag_t) String() string

type Mpo_flags_t

type Mpo_flags_t int64
const (
	MPO_PORT                            Mpo_flags_t = 0
	MPO_SERVICE_PORT                    Mpo_flags_t = 1024
	MPO_CONNECTION_PORT                 Mpo_flags_t = 2048
	MPO_REPLY_PORT                      Mpo_flags_t = 4096
	MPO_WEAK_REPLY_PORT                 Mpo_flags_t = 16384
	MPO_NOTIFICATION_PORT               Mpo_flags_t = 17408
	MPO_EXCEPTION_PORT                  Mpo_flags_t = 32768
	MPO_CONNECTION_PORT_WITH_PORT_ARRAY Mpo_flags_t = 65536
)

func (Mpo_flags_t) String

func (e Mpo_flags_t) String() string

type Os_clockid_t

type Os_clockid_t int64
const (
	OS_CLOCK_MACH_ABSOLUTE_TIME Os_clockid_t = 32
)

func (Os_clockid_t) String

func (e Os_clockid_t) String() string

type Ptrauth_key

type Ptrauth_key int64
const (
	Ptrauth_key_none                     Ptrauth_key = -1
	Ptrauth_key_asia                     Ptrauth_key = 0
	Ptrauth_key_asib                     Ptrauth_key = 1
	Ptrauth_key_asda                     Ptrauth_key = 2
	Ptrauth_key_asdb                     Ptrauth_key = 3
	Ptrauth_key_process_independent_code Ptrauth_key = 0
	Ptrauth_key_process_dependent_code   Ptrauth_key = 1
	Ptrauth_key_process_independent_data Ptrauth_key = 2
	Ptrauth_key_process_dependent_data   Ptrauth_key = 3
	Ptrauth_key_return_address           Ptrauth_key = 1
	Ptrauth_key_frame_pointer            Ptrauth_key = 3
	Ptrauth_key_function_pointer         Ptrauth_key = 0
	Ptrauth_key_block_function           Ptrauth_key = 0
	Ptrauth_key_cxx_vtable_pointer       Ptrauth_key = 2
	Ptrauth_key_method_list_pointer      Ptrauth_key = 2
	Ptrauth_key_objc_isa_pointer         Ptrauth_key = 2
	Ptrauth_key_objc_super_pointer       Ptrauth_key = 2
	Ptrauth_key_objc_sel_pointer         Ptrauth_key = 3
	Ptrauth_key_objc_class_ro_pointer    Ptrauth_key = 2
	Ptrauth_key_block_descriptor_pointer Ptrauth_key = 2
	Ptrauth_key_init_fini_pointer        Ptrauth_key = 0
)

func (Ptrauth_key) String

func (e Ptrauth_key) String() string

type Qos_class_t

type Qos_class_t uint32
const (
	QOS_CLASS_USER_INTERACTIVE Qos_class_t = 33
	QOS_CLASS_USER_INITIATED   Qos_class_t = 25
	QOS_CLASS_DEFAULT          Qos_class_t = 21
	QOS_CLASS_UTILITY          Qos_class_t = 17
	QOS_CLASS_BACKGROUND       Qos_class_t = 9
	QOS_CLASS_UNSPECIFIED      Qos_class_t = 0
)

func (Qos_class_t) String

func (e Qos_class_t) String() string

type Virtual_memory_guard_exception_code_t

type Virtual_memory_guard_exception_code_t int64
const (
	KGUARD_EXC_DEALLOC_GAP                   Virtual_memory_guard_exception_code_t = 1
	KGUARD_EXC_RECLAIM_COPYIO_FAILURE        Virtual_memory_guard_exception_code_t = 2
	KGUARD_EXC_RECLAIM_INDEX_FAILURE         Virtual_memory_guard_exception_code_t = 4
	KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE    Virtual_memory_guard_exception_code_t = 8
	KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE    Virtual_memory_guard_exception_code_t = 9
	KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE         Virtual_memory_guard_exception_code_t = 10
	KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE         Virtual_memory_guard_exception_code_t = 11
	KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION  Virtual_memory_guard_exception_code_t = 12
	KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY    Virtual_memory_guard_exception_code_t = 13
	KGUARD_EXC_SEC_ACCESS_FAULT              Virtual_memory_guard_exception_code_t = 98
	KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT        Virtual_memory_guard_exception_code_t = 99
	KGUARD_EXC_SEC_COPY_DENIED               Virtual_memory_guard_exception_code_t = 100
	KGUARD_EXC_SEC_SHARING_DENIED            Virtual_memory_guard_exception_code_t = 101
	KGUARD_EXC_MTE_SYNC_FAULT                Virtual_memory_guard_exception_code_t = 200
	KGUARD_EXC_MTE_ASYNC_USER_FAULT          Virtual_memory_guard_exception_code_t = 201
	KGUARD_EXC_MTE_ASYNC_KERN_FAULT          Virtual_memory_guard_exception_code_t = 202
	KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 203
	KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 204
)

func (Virtual_memory_guard_exception_code_t) String

type Xpc_listener_create_flags_t

type Xpc_listener_create_flags_t int64
const (
	XPC_LISTENER_CREATE_NONE             Xpc_listener_create_flags_t = 0
	XPC_LISTENER_CREATE_INACTIVE         Xpc_listener_create_flags_t = 1
	XPC_LISTENER_CREATE_FORCE_MACH       Xpc_listener_create_flags_t = 2
	XPC_LISTENER_CREATE_FORCE_XPCSERVICE Xpc_listener_create_flags_t = 4
)

func (Xpc_listener_create_flags_t) String

type Xpc_session_create_flags_t

type Xpc_session_create_flags_t int64
const (
	XPC_SESSION_CREATE_NONE            Xpc_session_create_flags_t = 0
	XPC_SESSION_CREATE_INACTIVE        Xpc_session_create_flags_t = 1
	XPC_SESSION_CREATE_MACH_PRIVILEGED Xpc_session_create_flags_t = 2
)

func (Xpc_session_create_flags_t) String

Jump to

Keyboard shortcuts

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