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

SDLSystemCapabilityManager Class Reference

Section Contents

Overview

A manager that handles updating and subscribing to SDL capabilities.

supportsSubscriptions

YES if subscriptions are available on the connected head unit. If NO, calls to subscribeToCapabilityType:withBlock and subscribeToCapabilityType:withObserver:selector will fail.

Objective-C

@property (readonly, assign, nonatomic) BOOL supportsSubscriptions;

Swift

var supportsSubscriptions: Bool { get }

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 (readonly, strong, nonatomic, nullable)
    NSArray<SDLDisplayCapability *> *displays;

Swift

var displays: [SDLDisplayCapability]? { get }

displayCapabilities

See

SDLDisplayCapabilities

Optional

Objective-C

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

Swift

var displayCapabilities: SDLDisplayCapabilities? { get }

hmiCapabilities

See

SDLHMICapabilities

Optional

Objective-C

@property (readonly, strong, nonatomic, 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 (readonly, copy, nonatomic, nullable)
    NSArray<SDLSoftButtonCapabilities *> *softButtonCapabilities;

Swift

var softButtonCapabilities: [SDLSoftButtonCapabilities]? { get }

buttonCapabilities

See

SDLButtonCapabilities

Optional, Array of length 1 - 100, of SDLButtonCapabilities

Objective-C

@property (readonly, copy, nonatomic, 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 (readonly, strong, nonatomic, nullable)
    SDLPresetBankCapabilities *presetBankCapabilities;

Swift

var presetBankCapabilities: SDLPresetBankCapabilities? { get }

hmiZoneCapabilities

See

SDLHMIZoneCapabilities

Optional, Array of length 1 - 100, of SDLHMIZoneCapabilities

Objective-C

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

Swift

var hmiZoneCapabilities: [SDLHMIZoneCapabilities]? { get }

speechCapabilities

See

SDLSpeechCapabilities

Optional, Array of length 1 - 100, of SDLSpeechCapabilities

Objective-C

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

Swift

var speechCapabilities: [SDLSpeechCapabilities]? { get }

prerecordedSpeechCapabilities

See

SDLPrerecordedSpeech

Optional, Array of length 1 - 100, of SDLPrerecordedSpeech

Objective-C

@property (readonly, copy, nonatomic, 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 (readonly, assign, nonatomic) BOOL vrCapability;

Swift

var vrCapability: Bool { get }

audioPassThruCapabilities

See

SDLAudioPassThruCapabilities

Optional, Array of length 1 - 100, of SDLAudioPassThruCapabilities

Objective-C

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

Swift

var audioPassThruCapabilities: [SDLAudioPassThruCapabilities]? { get }

pcmStreamCapability

See

SDLAudioPassThruCapabilities

Optional, Array of length 1 - 100, of SDLAudioPassThruCapabilities

Objective-C

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

Swift

var pcmStreamCapability: SDLAudioPassThruCapabilities? { get }

appServicesCapabilities

If returned, the platform supports app services

See

SDLAppServicesCapabilities

Optional

Objective-C

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

Swift

var appServicesCapabilities: SDLAppServicesCapabilities? { get }

navigationCapability

If returned, the platform supports navigation

See

SDLNavigationCapability

Optional

Objective-C

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

Swift

var navigationCapability: SDLNavigationCapability? { get }

phoneCapability

If returned, the platform supports making phone calls

See

SDLPhoneCapability

Optional

Objective-C

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

Swift

var phoneCapability: SDLPhoneCapability? { get }

videoStreamingCapability

If returned, the platform supports video streaming

See

SDLVideoStreamingCapability

Optional

Objective-C

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

Swift

var videoStreamingCapability: SDLVideoStreamingCapability? { get }

remoteControlCapability

If returned, the platform supports remote control capabilities

See

SDLRemoteControlCapabilities

Optional

Objective-C

@property (readonly, strong, nonatomic, 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 (readonly, strong, nonatomic, 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 (readonly, strong, nonatomic, nullable)
    SDLWindowCapability *defaultMainWindowCapability;

Swift

var defaultMainWindowCapability: SDLWindowCapability? { 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()

-updateCapabilityType:completionHandler:

Retrieves a capability type from the remote system. This function must be called in order to retrieve the values for navigationCapability, phoneCapability, videoStreamingCapability, remoteControlCapability, and appServicesCapabilities. If you do not call this method first, those values will be nil. After calling this method, assuming there is no error in the handler, you may retrieve the capability you requested from the manager within the handler.

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

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 subscriptions aren’t available on this head unit

-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

This method will be called immediately with the current value and called every time the value is updated on RPC v5.1.0+ systems (supportsSubscriptions == YES). If this method is called on a sub-v5.1.0 system (supportsSubscriptions == NO), the method will return NO and the selector will never be called.

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

Whether or not the subscription succeeded. NO if the connected system doesn’t support capability subscriptions, or if the selector doesn’t support the correct parameters (see above)

-unsubscribeFromCapabilityType:withObserver:

Unsubscribe from a particular capability type. If it was subscribed with a block, the return value should be passed to the observer to unsubscribe the block. If it was subscribed with a selector, the observer object 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.

-windowCapabilityWithWindowID:

Returns the window capability object of the primary display with the specified window ID. This is a convenient method to easily access capabilities of windows for instance widget windows of the main display.

Objective-C

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

Swift

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

Parameters

windowID

The ID of the window to get capabilities @returns The window capability object representing the window capabilities of the window with the specified window ID or nil if the window is not known or no window capabilities exist.

View on GitHub.com
Previous Section Next Section