Package apple.corebluetooth
Class CBPeripheral
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.corebluetooth.CBPeer
-
- apple.corebluetooth.CBPeripheral
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCBPeripheral(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static CBPeripheralalloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)booleanancsAuthorized()[@property] ancsAuthorized YES if the remote device has been authorized to receive data over ANCS (Apple Notification Service Center) protocol.static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)booleancanSendWriteWithoutResponse()[@property] canSendWriteWithoutResponse YES if the remote device has space to send a write without response.static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()static java.lang.StringdebugDescription_static()CBPeripheralDelegatedelegate()[@property] delegate The delegate object that will receive peripheral events.static java.lang.Stringdescription_static()voiddiscoverCharacteristicsForService(NSArray<? extends CBUUID> characteristicUUIDs, CBService service)discoverCharacteristics:forService: Discovers the specified characteristic(s) of service.voiddiscoverDescriptorsForCharacteristic(CBCharacteristic characteristic)discoverDescriptorsForCharacteristic: Discovers the characteristic descriptor(s) of characteristic.voiddiscoverIncludedServicesForService(NSArray<? extends CBUUID> includedServiceUUIDs, CBService service)discoverIncludedServices:forService: Discovers the specified included service(s) of service.voiddiscoverServices(NSArray<? extends CBUUID> serviceUUIDs)discoverServices: Discovers available service(s) on the peripheral.static longhash_static()CBPeripheralinit()static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)longmaximumWriteValueLengthForType(long type)maximumWriteValueLengthForType: The maximum amount of data, in bytes, that can be sent to a characteristic in a single write type.java.lang.Stringname()[@property] name The name of the peripheral.static java.lang.Objectnew_objc()voidopenL2CAPChannel(char PSM)openL2CAPChannel: Attempt to open an L2CAP channel to the peripheral using the supplied PSM.voidreadRSSI()readRSSI While connected, retrieves the current RSSI of the link.voidreadValueForCharacteristic(CBCharacteristic characteristic)readValueForCharacteristic: Reads the characteristic value for characteristic.voidreadValueForDescriptor(CBDescriptor descriptor)readValueForDescriptor: Reads the value of descriptor.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)NSNumberRSSI()Deprecated.Use {@link peripheral:didReadRSSI:error:} instead.NSArray<? extends CBService>services()[@property] services A list ofCBServiceobjects that have been discovered on the peripheral.voidsetDelegate(CBPeripheralDelegate value)[@property] delegate The delegate object that will receive peripheral events.voidsetDelegate_unsafe(CBPeripheralDelegate value)[@property] delegate The delegate object that will receive peripheral events.voidsetNotifyValueForCharacteristic(boolean enabled, CBCharacteristic characteristic)setNotifyValue:forCharacteristic: Enables or disables notifications/indications for the characteristic value of characteristic.static voidsetVersion_static(long aVersion)longstate()[@property] state The current connection state of the peripheral.static org.moe.natj.objc.Classsuperclass_static()static longversion_static()voidwriteValueForCharacteristicType(NSData data, CBCharacteristic characteristic, long type)writeValue:forCharacteristic:type: Writes value to characteristic's characteristic value.voidwriteValueForDescriptor(NSData data, CBDescriptor descriptor)writeValue:forDescriptor: Writes data to descriptor's value.-
Methods inherited from class apple.corebluetooth.CBPeer
copyWithZone, identifier
-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static CBPeripheral alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
RSSI
@Deprecated public NSNumber RSSI()
Deprecated.Use {@link peripheral:didReadRSSI:error:} instead.[@property] RSSI The most recently read RSSI, in decibels.
-
delegate
public CBPeripheralDelegate delegate()
[@property] delegate The delegate object that will receive peripheral events.
-
discoverCharacteristicsForService
public void discoverCharacteristicsForService(NSArray<? extends CBUUID> characteristicUUIDs, CBService service)
discoverCharacteristics:forService: Discovers the specified characteristic(s) of service.- Parameters:
characteristicUUIDs- A list ofCBUUIDobjects representing the characteristic types to be discovered. If nil, all characteristics of service will be discovered.service- A GATT service.
-
discoverDescriptorsForCharacteristic
public void discoverDescriptorsForCharacteristic(CBCharacteristic characteristic)
discoverDescriptorsForCharacteristic: Discovers the characteristic descriptor(s) of characteristic.- Parameters:
characteristic- A GATT characteristic.
-
discoverIncludedServicesForService
public void discoverIncludedServicesForService(NSArray<? extends CBUUID> includedServiceUUIDs, CBService service)
discoverIncludedServices:forService: Discovers the specified included service(s) of service.- Parameters:
includedServiceUUIDs- A list ofCBUUIDobjects representing the included service types to be discovered. If nil, all of services included services will be discovered, which is considerably slower and not recommended.service- A GATT service.
-
discoverServices
public void discoverServices(NSArray<? extends CBUUID> serviceUUIDs)
discoverServices: Discovers available service(s) on the peripheral.- Parameters:
serviceUUIDs- A list ofCBUUIDobjects representing the service types to be discovered. If nil, all services will be discovered.
-
init
public CBPeripheral init()
-
maximumWriteValueLengthForType
public long maximumWriteValueLengthForType(long type)
maximumWriteValueLengthForType: The maximum amount of data, in bytes, that can be sent to a characteristic in a single write type.
-
name
public java.lang.String name()
[@property] name The name of the peripheral.
-
readRSSI
public void readRSSI()
readRSSI While connected, retrieves the current RSSI of the link.
-
readValueForCharacteristic
public void readValueForCharacteristic(CBCharacteristic characteristic)
readValueForCharacteristic: Reads the characteristic value for characteristic.- Parameters:
characteristic- A GATT characteristic.
-
readValueForDescriptor
public void readValueForDescriptor(CBDescriptor descriptor)
readValueForDescriptor: Reads the value of descriptor.- Parameters:
descriptor- A GATT characteristic descriptor.
-
services
public NSArray<? extends CBService> services()
[@property] services A list ofCBServiceobjects that have been discovered on the peripheral.
-
setDelegate_unsafe
public void setDelegate_unsafe(CBPeripheralDelegate value)
[@property] delegate The delegate object that will receive peripheral events.
-
setDelegate
public void setDelegate(CBPeripheralDelegate value)
[@property] delegate The delegate object that will receive peripheral events.
-
setNotifyValueForCharacteristic
public void setNotifyValueForCharacteristic(boolean enabled, CBCharacteristic characteristic)setNotifyValue:forCharacteristic: Enables or disables notifications/indications for the characteristic value of characteristic. If characteristic allows both, notifications will be used. When notifications/indications are enabled, updates to the characteristic value will be received via delegate method [@link] peripheral:didUpdateValueForCharacteristic:error: @/link. Since it is the peripheral that chooses when to send an update, the application should be prepared to handle them as long as notifications/indications remain enabled.- Parameters:
enabled- Whether or not notifications/indications should be enabled.characteristic- The characteristic containing the client characteristic configuration descriptor.- See Also:
CBConnectPeripheralOptionNotifyOnNotificationKey
-
state
public long state()
[@property] state The current connection state of the peripheral.
-
writeValueForCharacteristicType
public void writeValueForCharacteristicType(NSData data, CBCharacteristic characteristic, long type)
writeValue:forCharacteristic:type: Writes value to characteristic's characteristic value. If theCBCharacteristicWriteWithResponsetype is specified, {@link peripheral:didWriteValueForCharacteristic:error:} is called with the result of the write request. If theCBCharacteristicWriteWithoutResponsetype is specified, and canSendWriteWithoutResponse is false, the delivery of the data is best-effort and may not be guaranteed.- Parameters:
data- The value to write.characteristic- The characteristic whose characteristic value will be written.type- The type of write to be executed.- See Also:
canSendWriteWithoutResponse(),CBCharacteristicWriteType
-
writeValueForDescriptor
public void writeValueForDescriptor(NSData data, CBDescriptor descriptor)
writeValue:forDescriptor: Writes data to descriptor's value. Client characteristic configuration descriptors cannot be written using this method, and should instead use @link setNotifyValue:forCharacteristic: @/link.- Parameters:
data- The value to write.descriptor- A GATT characteristic descriptor.
-
canSendWriteWithoutResponse
public boolean canSendWriteWithoutResponse()
[@property] canSendWriteWithoutResponse 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 peripheralIsReadyToSendWriteWithoutResponse: will be called.
-
openL2CAPChannel
public void openL2CAPChannel(char PSM)
openL2CAPChannel: Attempt to open an L2CAP channel to the peripheral using the supplied PSM.- Parameters:
PSM- The PSM of the channel to open
-
ancsAuthorized
public boolean ancsAuthorized()
[@property] ancsAuthorized YES if the remote device has been authorized to receive data over ANCS (Apple Notification Service Center) protocol. If this value is NO, the value will be set to YES after a user authorization occurs and didUpdateANCSAuthorizationForPeripheral: will be called.
-
-