Package apple.corebluetooth
Class CBCentralManager
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.corebluetooth.CBManager
-
- apple.corebluetooth.CBCentralManager
-
-
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 protectedCBCentralManager(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static CBCentralManageralloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static longauthorization_static()static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)voidcancelPeripheralConnection(CBPeripheral peripheral)cancelPeripheralConnection: Cancels an active or pending connection to peripheral.static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()voidconnectPeripheralOptions(CBPeripheral peripheral, NSDictionary<java.lang.String,?> options)connectPeripheral:options: Initiates a connection to peripheral.static java.lang.StringdebugDescription_static()CBCentralManagerDelegatedelegate()[@property] delegate The delegate object that will receive central events.static java.lang.Stringdescription_static()static longhash_static()CBCentralManagerinit()CBCentralManagerinitWithDelegateQueue(CBCentralManagerDelegate delegate, NSObject queue)initWithDelegate:queue: The initialization call.CBCentralManagerinitWithDelegateQueueOptions(CBCentralManagerDelegate delegate, NSObject queue, NSDictionary<java.lang.String,?> options)initWithDelegate:queue:options: The initialization call.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)booleanisScanning()[@property] isScanning Whether or not the central is currently scanning.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)static java.lang.Objectnew_objc()voidregisterForConnectionEventsWithOptions(NSDictionary<java.lang.String,?> options)registerForConnectionEventsWithOptions: Calls {@link centralManager:connectionEventDidOccur:forPeripheral:} when a connection event occurs matching any of the given options.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)NSArray<? extends CBPeripheral>retrieveConnectedPeripheralsWithServices(NSArray<? extends CBUUID> serviceUUIDs)retrieveConnectedPeripheralsWithServices Retrieves all peripherals that are connected to the system and implement any of the services listed in serviceUUIDs.NSArray<? extends CBPeripheral>retrievePeripheralsWithIdentifiers(NSArray<? extends NSUUID> identifiers)retrievePeripheralsWithIdentifiers: Attempts to retrieve theCBPeripheralobject(s) with the corresponding identifiers.voidscanForPeripheralsWithServicesOptions(NSArray<? extends CBUUID> serviceUUIDs, NSDictionary<java.lang.String,?> options)scanForPeripheralsWithServices:options: Starts scanning for peripherals that are advertising any of the services listed in serviceUUIDs.voidsetDelegate(CBCentralManagerDelegate value)[@property] delegate The delegate object that will receive central events.voidsetDelegate_unsafe(CBCentralManagerDelegate value)[@property] delegate The delegate object that will receive central events.static voidsetVersion_static(long aVersion)voidstopScan()stopScan: Stops scanning for peripherals.static org.moe.natj.objc.Classsuperclass_static()static booleansupportsFeatures(long features)supportsFeatures Returns a boolean value representing the support for the provided features.static longversion_static()-
Methods inherited from class apple.corebluetooth.CBManager
authorization, state
-
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 CBCentralManager 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()
-
cancelPeripheralConnection
public void cancelPeripheralConnection(CBPeripheral peripheral)
cancelPeripheralConnection: Cancels an active or pending connection to peripheral. Note that this is non-blocking, and anyCBPeripheralcommands that are still pending to peripheral may or may not complete.- Parameters:
peripheral- ACBPeripheral.
-
connectPeripheralOptions
public void connectPeripheralOptions(CBPeripheral peripheral, NSDictionary<java.lang.String,?> options)
connectPeripheral:options: Initiates a connection to peripheral. Connection attempts never time out and, depending on the outcome, will result in a call to either {@link centralManager:didConnectPeripheral:} or {@link centralManager:didFailToConnectPeripheral:error:}. Pending attempts are cancelled automatically upon deallocation of peripheral, and explicitly viacancelPeripheralConnection(apple.corebluetooth.CBPeripheral).- Parameters:
peripheral- TheCBPeripheralto be connected.options- An optional dictionary specifying connection behavior options.- See Also:
CBConnectPeripheralOptionNotifyOnConnectionKey,CBConnectPeripheralOptionNotifyOnDisconnectionKey,CBConnectPeripheralOptionNotifyOnNotificationKey,CBConnectPeripheralOptionEnableTransportBridgingKey,CBConnectPeripheralOptionRequiresANCS
-
delegate
public CBCentralManagerDelegate delegate()
[@property] delegate The delegate object that will receive central events.
-
init
public CBCentralManager init()
-
initWithDelegateQueue
public CBCentralManager initWithDelegateQueue(CBCentralManagerDelegate delegate, NSObject queue)
initWithDelegate:queue: The initialization call. The events of the central role will be dispatched on the provided queue. If nil, the main queue will be used.- Parameters:
delegate- The delegate that will receive central role events.queue- The dispatch queue on which the events will be dispatched.
-
initWithDelegateQueueOptions
public CBCentralManager initWithDelegateQueueOptions(CBCentralManagerDelegate delegate, NSObject queue, NSDictionary<java.lang.String,?> options)
initWithDelegate:queue:options: The initialization call. The events of the central role will be dispatched on the provided queue. If nil, the main queue will be used.- Parameters:
delegate- The delegate that will receive central role events.queue- The dispatch queue on which the events will be dispatched.options- An optional dictionary specifying options for the manager.- See Also:
CBCentralManagerOptionShowPowerAlertKey,CBCentralManagerOptionRestoreIdentifierKey
-
isScanning
public boolean isScanning()
[@property] isScanning Whether or not the central is currently scanning.
-
retrieveConnectedPeripheralsWithServices
public NSArray<? extends CBPeripheral> retrieveConnectedPeripheralsWithServices(NSArray<? extends CBUUID> serviceUUIDs)
retrieveConnectedPeripheralsWithServices Retrieves all peripherals that are connected to the system and implement any of the services listed in serviceUUIDs. Note that this set can include peripherals which were connected by other applications, which will need to be connected locally via {@link connectPeripheral:options:} before they can be used.- Returns:
- A list of
CBPeripheralobjects.
-
retrievePeripheralsWithIdentifiers
public NSArray<? extends CBPeripheral> retrievePeripheralsWithIdentifiers(NSArray<? extends NSUUID> identifiers)
retrievePeripheralsWithIdentifiers: Attempts to retrieve theCBPeripheralobject(s) with the corresponding identifiers.- Parameters:
identifiers- A list ofNSUUIDobjects.- Returns:
- A list of
CBPeripheralobjects.
-
scanForPeripheralsWithServicesOptions
public void scanForPeripheralsWithServicesOptions(NSArray<? extends CBUUID> serviceUUIDs, NSDictionary<java.lang.String,?> options)
scanForPeripheralsWithServices:options: Starts scanning for peripherals that are advertising any of the services listed in serviceUUIDs. Although strongly discouraged, if serviceUUIDs is nil all discovered peripherals will be returned. If the central is already scanning with different serviceUUIDs or options, the provided parameters will replace them. Applications that have specified thebluetooth-centralbackground mode are allowed to scan while backgrounded, with two caveats: the scan must specify one or more service types in serviceUUIDs, and theCBCentralManagerScanOptionAllowDuplicatesKeyscan option will be ignored.- Parameters:
serviceUUIDs- A list ofCBUUIDobjects representing the service(s) to scan for.options- An optional dictionary specifying options for the scan.- See Also:
CBCentralManagerScanOptionAllowDuplicatesKey,CBCentralManagerScanOptionSolicitedServiceUUIDsKey
-
setDelegate_unsafe
public void setDelegate_unsafe(CBCentralManagerDelegate value)
[@property] delegate The delegate object that will receive central events.
-
setDelegate
public void setDelegate(CBCentralManagerDelegate value)
[@property] delegate The delegate object that will receive central events.
-
stopScan
public void stopScan()
stopScan: Stops scanning for peripherals.
-
authorization_static
public static long authorization_static()
-
registerForConnectionEventsWithOptions
public void registerForConnectionEventsWithOptions(NSDictionary<java.lang.String,?> options)
registerForConnectionEventsWithOptions: Calls {@link centralManager:connectionEventDidOccur:forPeripheral:} when a connection event occurs matching any of the given options. Passing nil in the option parameter clears any prior registered matching options.- Parameters:
options- A dictionary specifying connection event options.- See Also:
CBConnectionEventMatchingOptionServiceUUIDs,CBConnectionEventMatchingOptionPeripheralUUIDs
-
supportsFeatures
public static boolean supportsFeatures(long features)
supportsFeatures Returns a boolean value representing the support for the provided features.- Parameters:
features- One or more features you would like to check if supported.
-
-