[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

api[apple,CoreBluetooth] methods

See also

CBCentralManager buildPool: #CBCentralManagerState with: #(
    0 #CBCentralManagerStateUnknown
    #CBCentralManagerStateResetting
    #CBCentralManagerStateUnsupported
    #CBCentralManagerStateUnauthorized
    #CBCentralManagerStatePoweredOff
    #CBCentralManagerStatePoweredOn
)!

CBCentralManager buildTypedAccessors: #(
	#(delegate #NSObject)
)!
CBCentralManager buildNumberGetters: #(
	state
)!

! CBCentralManager class methodsFor: #instantiation !
withDelegate: delegate queue: queue

	^self @ (self nativeClass instanceWithDelegate: delegate handle queue: queue handle)! !

! CBCentralManager class methodsFor: #instantiation !
withDelegate: delegate queue: queue options: options

	^self @ (self nativeClass instanceWithDelegate: delegate handle queue: queue handle options: options json)! !

CBCentralManager buildFunctions: #(
	#(#retrievePeripherals: #(peripheralUUIDs))
	retrieveConnectedPeripherals
	#(#retrievePeripheralsWithIdentifiers: #(#(identifiers handles)))
	#(#retrieveConnectedPeripheralsWithServices: #(#(serviceUUIDs handles)))
	#(#scanForPeripheralsWithServices:options: #(#(serviceUUIDs handles) options))
	stopScan
	#(#connectPeripheral:options: #(#(peripheral handle) options))
	#(#cancelPeripheralConnection: #(#(peripheral handle)))
)!


CBPeripheralManager buildPool: #CBPeripheralManagerAuthorizationStatus with: #(
    0 #CBPeripheralManagerAuthorizationStatusNotDetermined
    #CBPeripheralManagerAuthorizationStatusRestricted
    #CBPeripheralManagerAuthorizationStatusDenied
    #CBPeripheralManagerAuthorizationStatusAuthorized
)!

CBPeripheralManager buildPool: #CBPeripheralManagerState with: #(
    0 #CBPeripheralManagerStateUnknown
    #CBPeripheralManagerStateResetting
    #CBPeripheralManagerStateUnsupported
    #CBPeripheralManagerStateUnauthorized
    #CBPeripheralManagerStatePoweredOff
    #CBPeripheralManagerStatePoweredOn
)!

CBPeripheralManager buildPool: #CBPeripheralManagerConnectionLatency with: #(
    0 #CBPeripheralManagerConnectionLatencyLow
    #CBPeripheralManagerConnectionLatencyMedium
    #CBPeripheralManagerConnectionLatencyHigh
)!

CBPeripheralManager buildTypedAccessors: #(
	#(delegate #NSObject)
)!
CBPeripheralManager buildNumberGetters: #(
	state authorizationStatus
)!
CBPeripheralManager buildBooleanGetters: #(
	isAdvertising
)!

! CBPeripheralManager class methodsFor: #instantiation !
withDelegate: delegate queue: queue

	^self @ (self nativeClass instanceWithDelegate: delegate handle queue: queue handle)! !

! CBPeripheralManager class methodsFor: #instantiation !
withDelegate: delegate queue: queue options: options

	^self @ (self nativeClass instanceWithDelegate: delegate handle queue: queue handle options: options json)! !

CBPeripheralManager buildFunctions: #(
	#(#startAdvertising: #(advertisementData))
	stopAdvertising removeAllServices
	#(#setDesiredConnectionLatency:forCentral: #(advertisementData #(central handle)))
	#(#addService: #(#(service handle)))
	#(#removeService: #(#(service handle)))
	#(#respondToRequest:withResult: #(#(request handle) result))
	#(#updateValue:forCharacteristic:onSubscribedCentrals: #(#(value handle) #((characteristic handle) #(centrals handles)))
)!

CBPeer buildTypedGetters: #(
	#(identifier #NSUUID)
)!

CBPeripheral buildPool: #CBPeripheralState with: #(
    0 #CBPeripheralStateDisconnected
    #CBPeripheralStateConnecting
    #CBPeripheralStateConnected
)!
CBPeripheral buildPool: #CBCharacteristicWriteType with: #(
    0 #CBCharacteristicWriteWithResponse
    #CBCharacteristicWriteWithoutResponse
)!

CBPeripheral buildTypedAccessors: #(
	#(delegate #NSObject)
)!
CBPeripheral buildGetters: #(
	name services
)!
CBPeripheral buildBooleanGetters: #(
	isConnected
)!
CBPeripheral buildNumberGetters: #(
	state
)!
CBPeripheral buildFunctions: #(
	readRSSI
	#(#discoverServices: #(#(serviceUUIDs handles)))
	#(#discoverIncludedServices:forService: #(#(serviceUUIDs handles) #(service handle)))
	#(#discoverCharacteristics:forService: #(#(characteristicUUIDs handles) #(service handle)))
	#(#readValueForCharacteristic: #(#(characteristic handle)))
	#(#writeValue:forCharacteristic:type: #(#(data handle) #(characteristic handle) type))
	#(#setNotifyValue:forCharacteristic: #(enabled #(characteristic handle)))
	#(#discoverDescriptorsForCharacteristic: #(#(characteristic handle)))
	#(#readValueForDescriptor: #(#(descriptor handle)))
	#(#writeValue:forDescriptor: #(#(data handle) #(descriptor handle)))
)!

CBCentral buildNumberGetters: #(
	maximumUpdateValueLength
)!

! CBAttribute methodsFor: #accessing !
uuid
    ^CBUUID @ handle[#UUID]! !

CBService  buildTypedGetters: #(
	#(peripheral #CBPeripheral)
)!
CBService  buildBooleanGetters: #(
	isPrimary
)!
CBService  buildGetters: #(
	includedServices
	characteristics
)!

CBService subclass: #CBMutableService!
 
CBMutableService  buildTypedSetters: #(
	#(peripheral #CBPeripheral)
)!
CBMutableService  buildBooleanSetters: #(
	isPrimary
)!
CBMutableService  buildSetters: #(
	includedServices
	characteristics
)!

! CBMutableService class methodsFor: #instantiation !
withType: uuid primary: isPrimary

	^self @ (self nativeClass instanceWithType: uuid handle primary: isPrimary)! !

CBCharacteristic buildPool: #CBCharacteristicProperties with: #(
    16r01 #CBCharacteristicPropertyBroadcast
    16r02 #CBCharacteristicPropertyRead
    16r04 #CBCharacteristicPropertyWriteWithoutResponse
    16r08 #CBCharacteristicPropertyWrite
    16r10 #CBCharacteristicPropertyNotify
    16r20 #CBCharacteristicPropertyIndicate
    16r40 #CBCharacteristicPropertyAuthenticatedSignedWrites
    16r80 #CBCharacteristicPropertyExtendedProperties
    16r100 #CBCharacteristicPropertyNotifyEncryptionRequired
    16r200 #CBCharacteristicPropertyIndicateEncryptionRequired
)!

CBCharacteristic buildTypedAccessors: #(
	#(service #CBService)
	#(value #NSData)
)!
CBCharacteristic buildNumberGetters: #(
	properties
)!
CBCharacteristic buildGetters: #(
	descriptors
)!
CBCharacteristic buildBooleanGetters: #(
	isBroadcasted isNotifying
)!
CBCharacteristic buildPool: #CBAttributePermissions with: #(
    16r01 #CBAttributePermissionsReadable
    16r02 #CBAttributePermissionsWriteable
    16r04 #CBAttributePermissionsReadEncryptionRequired
    16r08 #CBAttributePermissionsWriteEncryptionRequired
)!

CBCharacteristic subclass: #CBMutableCharacteristic!

CBMutableCharacteristic buildNumberAccessors: #(
	permissions properties
)!
CBMutableCharacteristic buildGetters: #(
	subscribedCentrals
)!
CBMutableCharacteristic buildAccessors: #(
	descriptors
)!
CBMutableCharacteristic buildTypedAccessors: #(
	#(value #NSData)
)!

! CBMutableCharacteristic class methodsFor: #instantiation !
withType: uuid properties: properties value: value permissions: permissions

	^self @ (self nativeClass
		instanceWithType: uuid handle
		properties: properties
		value: value handle
		permissions: permissions)! !

! CBMutableCharacteristic methodsFor: #accessing !
uuid
    ^CBUUID @ handle[#UUID]! !

! CBMutableCharacteristic methodsFor: #accessing !
uuid: aCBUUID
    handle[#UUID] := aCBUUID handle! !


CBDescriptor buildTypedGetters: #(
	#(characteristic #CBCharacteristic)
	#(value #NSObject)
)!

CBDescriptor subclass: #CBMutableDescriptor!

! CBMutableDescriptor class methodsFor: #instantiation !
withType: uuid value: value

	^self @ (self nativeClass instanceWithType: uuid handle value: value handle)!

CBUUID buildTypedGetters: #(
	#(data #NSData)
)!

! CBUUID methodsFor: #accessing !
uuidString
	^value basicAt: #UUIDString!

! CBUUID class methodsFor: #instantiation !
withString: aString
	^self @ (self nativeClass #UUIDWithString: aString)!

! CBUUID class methodsFor: #instantiation !
withData: data
	^self @ (self nativeClass #UUIDWithData: data handle)!

! CBUUID class methodsFor: #instantiation !
withCFUUID: theUUID
	^self @ (self nativeClass #UUIDWithCFUUID: theUUID handle)!

! CBUUID class methodsFor: #instantiation !
withNSUUID: theUUID
	^self @ (self nativeClass #UUIDWithNSUUID: theUUID handle)!

CBATTRequest buildTypedGetter: #(
	#(central #CBCentral)
	#(characteristic #CBCharacteristic)
	#(value #NSData)
)!
CBATTRequest buildNumberGetter: #(
	offset
)!