Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
SDLSystemCapabilityManager

SDLSystemCapabilityManager Class Reference

Section Contents

Overview

A manager that handles updating and subscribing to SDL capabilities.

displays

Provides window capabilities of all displays connected with SDL. By default, one display is connected and supported which includes window capability information of the default main window of the display. May be nil if the system has not provided display and window capability information yet.

See

SDLDisplayCapability

Optional, @since SDL 6.0

Objective-C

@property (nonatomic, strong, readonly, nullable) NSArray<SDLDisplayCapability *> *displays;

Swift

var displays: [SDLDisplayCapability]? { get }

displayCapabilities

See

SDLDisplayCapabilities

Optional

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLDisplayCapabilities *displayCapabilities;

Swift

var displayCapabilities: SDLDisplayCapabilities? { get }

hmiCapabilities

See

SDLHMICapabilities

Optional

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLHMICapabilities *hmiCapabilities;

Swift

var hmiCapabilities: SDLHMICapabilities? { get }

softButtonCapabilities

If returned, the platform supports on-screen SoftButtons

See

SDLSoftButtonCapabilities

Optional, Array of length 1 - 100, of SDLSoftButtonCapabilities

Objective-C

@property (nonatomic, copy, readonly, nullable) NSArray<SDLSoftButtonCapabilities *> *softButtonCapabilities;

Swift

var softButtonCapabilities: [SDLSoftButtonCapabilities]? { get }

buttonCapabilities

See

SDLButtonCapabilities

Optional, Array of length 1 - 100, of SDLButtonCapabilities

Objective-C

@property (nonatomic, copy, readonly, nullable) NSArray<SDLButtonCapabilities *> *buttonCapabilities;

Swift

var buttonCapabilities: [SDLButtonCapabilities]? { get }

presetBankCapabilities

If returned, the platform supports custom on-screen Presets

See

SDLPresetBankCapabilities

Optional

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLPresetBankCapabilities *presetBankCapabilities;

Swift

var presetBankCapabilities: SDLPresetBankCapabilities? { get }

hmiZoneCapabilities

See

SDLHMIZoneCapabilities

Optional, Array of length 1 - 100, of SDLHMIZoneCapabilities

Objective-C

@property (nonatomic, copy, readonly, nullable) NSArray<SDLHMIZoneCapabilities> *hmiZoneCapabilities;

Swift

var hmiZoneCapabilities: [SDLHMIZoneCapabilities]? { get }

speechCapabilities

See

SDLSpeechCapabilities

Optional, Array of length 1 - 100, of SDLSpeechCapabilities

Objective-C

@property (nonatomic, copy, readonly, nullable) NSArray<SDLSpeechCapabilities> *speechCapabilities;

Swift

var speechCapabilities: [SDLSpeechCapabilities]? { get }

prerecordedSpeechCapabilities

See

SDLPrerecordedSpeech

Optional, Array of length 1 - 100, of SDLPrerecordedSpeech

Objective-C

@property (nonatomic, copy, readonly, nullable) NSArray<SDLPrerecordedSpeech> *prerecordedSpeechCapabilities;

Swift

var prerecordedSpeechCapabilities: [SDLPrerecordedSpeech]? { get }

vrCapability

See

SDLVRCapabilities

True if the head unit supports voice recognition; false if not.

Objective-C

@property (nonatomic, readonly) BOOL vrCapability;

Swift

var vrCapability: Bool { get }

audioPassThruCapabilities

See

SDLAudioPassThruCapabilities

Optional, Array of length 1 - 100, of SDLAudioPassThruCapabilities

Objective-C

@property (nonatomic, copy, readonly, nullable) NSArray<SDLAudioPassThruCapabilities *> *audioPassThruCapabilities;

Swift

var audioPassThruCapabilities: [SDLAudioPassThruCapabilities]? { get }

pcmStreamCapability

See

SDLAudioPassThruCapabilities

Optional, Array of length 1 - 100, of SDLAudioPassThruCapabilities

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLAudioPassThruCapabilities *pcmStreamCapability;

Swift

var pcmStreamCapability: SDLAudioPassThruCapabilities? { get }

appServicesCapabilities

If returned, the platform supports app services

See

SDLAppServicesCapabilities

Optional

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLAppServicesCapabilities *appServicesCapabilities;

Swift

var appServicesCapabilities: SDLAppServicesCapabilities? { get }

navigationCapability

If returned, the platform supports navigation

See

SDLNavigationCapability

Optional

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLNavigationCapability *navigationCapability;

Swift

var navigationCapability: SDLNavigationCapability? { get }

phoneCapability

If returned, the platform supports making phone calls

See

SDLPhoneCapability

Optional

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLPhoneCapability *phoneCapability;

Swift

var phoneCapability: SDLPhoneCapability? { get }

videoStreamingCapability

If returned, the platform supports video streaming

See

SDLVideoStreamingCapability

Optional

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLVideoStreamingCapability *videoStreamingCapability;

Swift

var videoStreamingCapability: SDLVideoStreamingCapability? { get }

remoteControlCapability

If returned, the platform supports remote control capabilities

See

SDLRemoteControlCapabilities

Optional

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLRemoteControlCapabilities *remoteControlCapability;

Swift

var remoteControlCapability: SDLRemoteControlCapabilities? { get }

seatLocationCapability

If returned, the platform supports remote control capabilities for seats

See

SDLSeatLocationCapability

Optional

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLSeatLocationCapability *seatLocationCapability;

Swift

var seatLocationCapability: SDLSeatLocationCapability? { get }

defaultMainWindowCapability

Returns the window capability object of the default main window which is always pre-created by the connected system. This is a convenience method for easily accessing the capabilities of the default main window.

@returns The window capability object representing the default main window capabilities or nil if no window capabilities exist.

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLWindowCapability *defaultMainWindowCapability;

Swift

var defaultMainWindowCapability: SDLWindowCapability? { get }

supportsSubscriptions

YES if subscriptions are available on the connected module and you will automatically be notified if the value changes on the module. If NO, calls to subscribe methods will subscribe to updates, but the module will not automatically notify you. You will need to call updateWithCapabilityType:completionHandler: to force an update if you need one (though this should be rare). This does not apply to the DISPLAYS capability type which you can always subscribe to.

Objective-C

@property (nonatomic, readonly) BOOL supportsSubscriptions;

Swift

var supportsSubscriptions: Bool { get }

-init

Init is unavailable. Dependencies must be injected using initWithConnectionManager:

Objective-C

- (nonnull instancetype)init;

Return Value

nil

-initWithConnectionManager:

Creates a new system capability manager with a specified connection manager

Objective-C

- (nonnull instancetype)initWithConnectionManager:
    (nonnull id<SDLConnectionManagerType>)manager;

Parameters

manager

A connection manager to use to forward on RPCs

Return Value

An instance of SDLSystemCapabilityManager

-start

Starts the manager. This method is used internally.

Objective-C

- (void)start;

Swift

func start()

-stop

Stops the manager. This method is used internally.

Objective-C

- (void)stop;

Swift

func stop()

-windowCapabilityWithWindowID:

Returns the window capability of one of your app’s windows with the specified window ID that is on the primary display (i.e. the head unit itself). This is a convenience method to easily access capabilities of windows such as your apps’ widget windows.

To get the capabilities of the main window on the main display (i.e. your app’s primary app screen on the head unit itself).

Objective-C

- (nullable SDLWindowCapability *)windowCapabilityWithWindowID:
    (NSUInteger)windowID;

Swift

func windowCapability(withWindowID windowID: UInt) -> SDLWindowCapability?

Parameters

windowID

The ID of the window from which to get capabilities @returns The window window capabilities of the window with the specified windowID, or nil if the window is not known or no window capabilities exist.

-isCapabilitySupported:

Returns whether or not the capability type is supported on the module. You can use this to check if subscribing to the capability will work. If this returns NO, then the feature is not supported by the head unit. If YES, the feature is supported by the head unit. You can subscribe to the capability type to get more information about the capability’s support and features on the connected module.

Objective-C

- (BOOL)isCapabilitySupported:(nonnull SDLSystemCapabilityType)type;

Swift

func isCapabilitySupported(type: SDLSystemCapabilityType) -> Bool

Parameters

type

The SystemCapabilityType that will be checked.

Return Value

Whether or not type is supported by the connected head unit.

-updateCapabilityType:completionHandler:

This method has been superseded by the subscribeToCapabilityType: methods. You should use one of those methods instead unless you only want a value once (you don’t want to keep a long-lasting observer) and it must be current (most capabilities do not need to be updated). If you have a separate subscription observer and are connected to a head unit that does not support subscriptions, when this method returns, it will also call all subscription callbacks that you’ve set up with the new value if there is one. Therefore, you can use this method to force an update to all subscriptions of that particular type on head units that don’t support subscriptions (supportsSubscriptions == NO).

Objective-C

- (void)updateCapabilityType:(nonnull SDLSystemCapabilityType)type
           completionHandler:(nonnull SDLUpdateCapabilityHandler)handler;

Swift

func updateCapabilityType(_ type: SDLSystemCapabilityType, completionHandler handler: @escaping SDLUpdateCapabilityHandler)

Parameters

type

The type of capability to retrieve

handler

The handler to be called when the retrieval is complete

-subscribeToCapabilityType:withBlock:

Subscribe to a particular capability type using a block callback.

On v5.1.0+ systems (where supportsSubscriptions == YES): This method will be called immediately with the current value if a subscription already exists and will be called every time the value is updated.

On sub-v5.1.0 systems (where supportsSubscriptions == NO): The method will be called immediately with the current value and will not be automatically called every time the value is updated, unless the type is DISPLAYS which is supported on every version. If updateCapabilityType:completionHandler is called and a new value is retrieved, this value will be updated then. If this is the first subscription of this SDLSystemCapabilityType, then the value will be retrieved and returned.

Objective-C

- (nullable id<NSObject>)
    subscribeToCapabilityType:(nonnull SDLSystemCapabilityType)type
                    withBlock:(nonnull SDLCapabilityUpdateHandler)block;

Swift

func subscribe(toCapabilityType type: SDLSystemCapabilityType, with block: @escaping SDLCapabilityUpdateHandler) -> NSObjectProtocol?

Parameters

type

The type of capability to subscribe to

block

The block to be called when the capability is updated

Return Value

An object that can be used to unsubscribe the block using unsubscribeFromCapabilityType:withObserver: by passing it in the observer callback, or nil if the manager can’t attempt the subscription for some reason (such as the app being in HMI_NONE and the type is not DISPLAYS).

-subscribeToCapabilityType:withUpdateHandler:

Subscribe to a particular capability type using a handler callback.

On v5.1.0+ systems (where supportsSubscriptions == YES): This method will be called immediately with the current value if a subscription already exists and will be called every time the value is updated.

Note that when the cached value is returned, the subscribed flag on the handler will be false until the subscription completes successfully and a new value is retrieved.

On sub-v5.1.0 systems (where supportsSubscriptions == NO): The method will be called immediately with the current value and will not be automatically called every time the value is updated, unless the type is DISPLAYS which is supported on every version. If updateCapabilityType:completionHandler is called and a new value is retrieved, this value will be updated then. If this is the first subscription of this SDLSystemCapabilityType, then the value will be retrieved and returned.

Objective-C

- (nullable id<NSObject>)
    subscribeToCapabilityType:(nonnull SDLSystemCapabilityType)type
            withUpdateHandler:
                (nonnull SDLCapabilityUpdateWithErrorHandler)handler;

Swift

func subscribe(capabilityType type: SDLSystemCapabilityType, updateHandler handler: @escaping SDLCapabilityUpdateWithErrorHandler) -> NSObjectProtocol?

Parameters

type

The type of capability to subscribe to

handler

The block to be called when the capability is updated with an error if one occurs

Return Value

An object that can be used to unsubscribe the block using unsubscribeFromCapabilityType:withObserver: by passing it in the observer callback, or nil if the manager can’t attempt the subscription for some reason (such as the app being in HMI_NONE and the type is not DISPLAYS).

-subscribeToCapabilityType:withObserver:selector:

Subscribe to a particular capability type with a selector callback.

The selector supports the following parameters:

  1. No parameters e.g. - (void)phoneCapabilityUpdated;

  2. One SDLSystemCapability * parameter, e.g. - (void)phoneCapabilityUpdated:(SDLSystemCapability *)capability

  3. Two parameters, one SDLSystemCapability * parameter, and one NSError parameter, e.g. - (void)phoneCapabilityUpdated:(SDLSystemCapability *)capability error:(NSError *)error

  4. Three parameters, one SDLSystemCapability * parameter, one NSError parameter, and one BOOL parameter e.g. - (void)phoneCapabilityUpdated:(SDLSystemCapability *)capability error:(NSError *)error subscribed:(BOOL)subscribed

On v5.1.0+ systems (where supportsSubscriptions == YES): This method will be called immediately with the current value if a subscription already exists and will be called every time the value is updated.

On sub-v5.1.0 systems (where supportsSubscriptions == NO): The method will be called immediately with the current value and will not be automatically called every time the value is updated, unless the type is DISPLAYS which is supported on every version. If updateCapabilityType:completionHandler is called and a new value is retrieved, this value will be updated then. If this is the first subscription of this SDLSystemCapabilityType, then the value will be retrieved and returned.

Objective-C

- (BOOL)subscribeToCapabilityType:(nonnull SDLSystemCapabilityType)type
                     withObserver:(nonnull id)observer
                         selector:(nonnull SEL)selector;

Swift

func subscribe(toCapabilityType type: SDLSystemCapabilityType, withObserver observer: Any, selector: Selector) -> Bool

Parameters

type

The type of the system capability to subscribe to

observer

The object that will have selector called whenever the capability is updated

selector

The selector on observer that will be called whenever the capability is updated

Return Value

YES if the manager is attempting the subscription, or NO if the manager can’t attempt the subscription for some reason (such as the app being in HMI_NONE and the type is not DISPLAYS), or the selector doesn’t contain the correct number of parameters.

-unsubscribeFromCapabilityType:withObserver:

Unsubscribe from a particular capability type. If it was subscribed with a block / handler, the return value should be passed to the observer to unsubscribe the block. If it was subscribed with a selector, the observer object (on which the selector exists and is called) should be passed to unsubscribe the object selector.

Objective-C

- (void)unsubscribeFromCapabilityType:(nonnull SDLSystemCapabilityType)type
                         withObserver:(nonnull id)observer;

Swift

func unsubscribe(fromCapabilityType type: SDLSystemCapabilityType, withObserver observer: Any)

Parameters

type

The type of the system capability to unsubscribe from

observer

The object that will be unsubscribed. If a block was subscribed, the return value should be passed. If a selector was subscribed, the observer object should be passed.

View on GitHub.com
Previous Section Next Section