ADC Home > Reference Library > Reference > Hardware & Drivers > Bluetooth > Bluetooth User Interface Framework Reference
|
IOBluetoothServiceBrowserController |
Inherits from: | |
Declared In: |
A NSWindowController subclass to display a window to search for and perform SDP queries on bluetooth devices within range.
This NSWindowController subclass will bring up a generic Bluetooth search and SDP browsing window allowing the user to find devices within range, perform SDP queries on a particular device, and select a SDP service to connect to. The client application can provide NSArrays of valid service UUIDs to allow, and an NSArray of valid device types to allow. The device type filter is not yet implemented.
addAllowedUUID: |
Adds a UUID to the list of UUIDs that are used to validate the user's selection.
- (void)addAllowedUUID:(IOBluetoothSDPUUID *)allowedUUID;
allowedUUID
The user's device selection gets validated against the UUIDs passed to -addAllowedUUID:
addAllowedUUIDArray:. Each call to those methods essentially adds a filter that the
selected device gets validated with. If any of the filters match, the device is considered
valid. If they all fail, the device is not valid and the user is presented with an
error code that the device does not support the required services. The UUID passed to
-addAllowedUUID: is the only UUID that must be present in the device's SDP service records.
Alternatively, all of the UUIDs in the UUID array passed to -addAllowedUUIDArray must be
present.
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
addAllowedUUIDArray: |
Adds an array of UUIDs to the list of UUIDs that are used to validate the user's selection.
- (void)addAllowedUUIDArray:(NSArray *)allowedUUIDArray;
allowedUUIDArray
The user's device selection gets validated against the UUIDs passed to -addAllowedUUID:
addAllowedUUIDArray:. Each call to those methods essentially adds a filter that the
selected device gets validated with. If any of the filters match, the device is considered
valid. If they all fail, the device is not valid and the user is presented with an
error code that the device does not support the required services. The UUID passed to
-addAllowedUUID: is the only UUID that must be present in the device's SDP service records.
Alternatively, all of the UUIDs in the UUID array passed to -addAllowedUUIDArray must be
present.
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo: |
Runs the service browser panel as a sheet on the target window.
- (IOReturn)beginSheetModalForWindow:(NSWindow *)sheetWindow modalDelegate:(id)modalDelegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;
sheetWindow
modalDelegate
didEndSelector
contextInfo
Returns kIOReturnSuccess if the sheet modal session was started.
This function works the same way as -[NSApplication beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:].
The didEndSelector has a similar prototype as in NSApplication except that the first argument is the
IOBluetoothServiceBrowserController object instead of the window:
-(void)sheetDidEnd:(IOBluetoothServiceBrowserController *)controller returnCode:(int)returnCode contextInfo:(void *)contextInfo.
The returnCode parameter will either be kIOBluetoothUISuccess or kIOBluetoothUIUserCancelledErr as described in
-runModal.
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
browseDevices:options: |
+(IOReturn)browseDevices:(IOBluetoothSDPServiceRecord**)outRecord options:(IOBluetoothServiceBrowserControllerOptions)inOptions DEPRECATED_IN_BLUETOOTH_VERSION_2_0_AND_LATER;
outRecord
inOptions
IOReturn -
kIOReturnSuccess - on successful completion.
kCanceledErr - User canceled.
***WARNING*** This method has been deprecated in favor of -setOptions:, -runModal and -getResults.
This method allocates and runs the browser window as a modal window waiting for the user to either select a
service, or cancel the browser window.
browseDevicesAsSheetForWindow:options:window: |
+(IOReturn)browseDevicesAsSheetForWindow:(IOBluetoothSDPServiceRecord**)outRecord options:(IOBluetoothServiceBrowserControllerOptions)inOptions window:(NSWindow*)inWindow DEPRECATED_IN_BLUETOOTH_VERSION_2_0_AND_LATER;
outRecord
inOptions
inWindow
IOReturn -
kIOReturnSuccess - on successful completion.
kCanceledErr - User canceled.
***WARNING*** This method has been deprecated in favor of - beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:.
This method will allocate and run the IOBluetoothServiceBrowserController browser window as a sheet for a window.
clearAllowedUUIDs |
Resets the controller back to the default state where it will accept any device the user selects.
- (void)clearAllowedUUIDs;
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
discover: |
Invoke an already created window controller to display, and run the modal dialog.
-(IOReturn)discover:(IOBluetoothSDPServiceRecord **)outRecord DEPRECATED_IN_BLUETOOTH_VERSION_2_0_AND_LATER;
outRecord
IOReturn -
kIOReturnSuccess - on successful completion.
kCanceledErr - User canceled.
***WARNING*** This method has been deprecated in favor of -runModal and -getResults.
This method will run the IOBluetoothServiceBrowserController browser window modally.
discoverAsSheetForWindow:withRecord: |
Invoke an already created window controller to display, and run the modal dialog.
-(IOReturn)discoverAsSheetForWindow:(NSWindow *)sheetWindow withRecord:(IOBluetoothSDPServiceRecord **)outRecord DEPRECATED_IN_BLUETOOTH_VERSION_2_0_AND_LATER;
sheetWindow
outRecord
IOReturn -
kIOReturnSuccess - on successful completion.
kCanceledErr - User canceled.
***WARNING*** This method has been deprecated in favor of -beginSheetModalForWindow:... and -getResults.
This method will run the IOBluetoothServiceBrowserController browser window as a sheet for the window passed to it in sheetWindow.
discoverWithDeviceAttributes:serviceList:serviceRecord: |
Invoke an already created window controller to display, and run the modal dialog.
-(IOReturn)discoverWithDeviceAttributes:(IOBluetoothDeviceSearchAttributes *)deviceAttributes serviceList:(NSArray *)serviceArray serviceRecord:(IOBluetoothSDPServiceRecord**)outRecord DEPRECATED_IN_BLUETOOTH_VERSION_2_0_AND_LATER;
serviceArray
outRecord
IOReturn -
kIOReturnSuccess - on successful completion.
kCanceledErr - User canceled.
***WARNING*** This method has been deprecated in favor of -setSearchAttributes:, -addAllowedUUID:, -runModal and -getResults.
This method will run the IOBluetoothServiceBrowserController browser window as a sheet for the window passed to it in sheetWindow.
getDescriptionText |
Returns the description text that appears in the device selector panel (i.e. what was set in -setDescriptionText:).
- (NSString *)getDescriptionText;
Returns the description text of the device selector panel.
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
getOptions |
Returns the option bits that control the panel's behavior.
- (IOBluetoothServiceBrowserControllerOptions)getOptions;
Returns the option bits set by setOptions:
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
getPrompt |
Returns the title of the default/select button in the device selector panel (i.e. what was set in -setPrompt:).
- (NSString *)getPrompt;
Returns the default button title of the device selector panel.
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
getResults |
Returns the result of the user's selection.
- (NSArray *)getResults;
Returns an NSArray of IOBluetoothSDPServiceRecord objects corresponding to the user's selection. If the user cancelled the panel, nil will be returned.
There will only be results if the panel has been run, the user has successfully made a selection and that
selection has been validated. If kIOBluetoothUISuccess was returned for the session, there should be valid
results. Currently only a single device is allowed to be selected, so the results array will only contain
one object. However in the future multiple selection will be supported.
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
getSearchAttributes |
Returns the search attributes that control the panel's search/inquiry behavior.
- (const IOBluetoothDeviceSearchAttributes *)getSearchAttributes;
Returns the search attributes set by setSearchAttributes:
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
getServiceBrowserControllerRef |
Returns an IOBluetoothServiceBrowserControllerRef representation of the target IOBluetoothServiceBrowserController object.
- (IOBluetoothServiceBrowserControllerRef)getServiceBrowserControllerRef;
Returns an IOBluetoothServiceBrowserControllerRef representation of the target IOBluetoothServiceBrowserController object.
getTitle |
Returns the title of the device selector panel (i.e. what was set in -setTitle:).
- (NSString *)getTitle;
Returns the title of the device selector panel.
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
runModal |
Runs the service browser panel in a modal session to allow the user to select a service on a Bluetooth device.
- (int)runModal;
Returns kIOBluetoothUISuccess if a successful, validated service selection was made by the user. Returns kIOBluetoothUIUserCanceledErr if the user cancelled the panel. These return values are the same as NSRunStoppedResponse and NSRunAbortedResponse respectively. They are the standard values used in a modal session.
The controller will use the panel attributes to filter what devices the user sees. The allowed UUIDs
will be used to validate the selection the user makes. The user will only be able to select services
that match the allowed UUIDs. Only when a selection has been validated (or
the panel cancelled), will this method return.
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
serviceBrowserController: |
Allocator work Bluetooth Service Browser window controller.
+(IOBluetoothServiceBrowserController *) serviceBrowserController:(IOBluetoothServiceBrowserControllerOptions)inOptions;
inOptions
a new instance of the IOBluetoothServiceBrowserController Controller, nil if unsuccessful.
setDescriptionText: |
Sets the description text that appears in the device selector panel.
- (void)setDescriptionText:(NSString *)descriptionText;
descriptionText
The description text should be localized for best user experience.
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
setOptions: |
Modify the options for the window controller.
-(void)setOptions:(IOBluetoothServiceBrowserControllerOptions)inOptions;
inOptions
None.
This method will set the options for the browser to new values.
setPrompt: |
Sets the title of the default/select button in the device selector panel.
- (void)setPrompt:(NSString *)prompt;
prompt
The prompt text should be localized for best user experience.
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
setSearchAttributes: |
Sets the search attributes that control the panel's search/inquiry behavior.
- (void)setSearchAttributes:(const IOBluetoothDeviceSearchAttributes *)searchAttributes;
searchAttributes
The device search attributes control the inquiry behavior of the panel. They allow only devices
that match the specified attributes (i.e. class of device) to be displayed to the user. Note that
this only covers attributes returned in an inquiry result and not actual SDP services on the device.
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
setTitle: |
Sets the title of the panel when not run as a sheet.
- (void)setTitle:(NSString *)windowTitle;
windowTitle
The panel title should be localized for best user experience.
NOTE: This method is only available in Mac OS X 10.2.4 (Bluetooth v1.1) or later.
withServiceBrowserControllerRef: |
Method call to convert an IOBluetoothServiceBrowserControllerRef into an IOBluetoothServiceBrowserController *.
+ (IOBluetoothServiceBrowserController *) withServiceBrowserControllerRef:(IOBluetoothServiceBrowserControllerRef)serviceBrowserControllerRef;
serviceBrowserControllerRef
Returns the IOBluetoothServiceBrowserController * for the given IOBluetoothServiceBrowserControllerRef.
|