A manager that handles updating and subscribing to SDL capabilities.
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
SDLDisplayCapabilityOptional, @since SDL 6.0
@property (nonatomic, strong, readonly, nullable) NSArray<SDLDisplayCapability *> *displays;
var displays: [SDLDisplayCapability]? { get }
See
SDLDisplayCapabilitiesOptional
@property (nonatomic, strong, readonly, nullable) SDLDisplayCapabilities *displayCapabilities;
var displayCapabilities: SDLDisplayCapabilities? { get }
See
SDLHMICapabilitiesOptional
@property (nonatomic, strong, readonly, nullable) SDLHMICapabilities *hmiCapabilities;
var hmiCapabilities: SDLHMICapabilities? { get }
If returned, the platform supports on-screen SoftButtons
See
SDLSoftButtonCapabilitiesOptional, Array of length 1 - 100, of SDLSoftButtonCapabilities
@property (nonatomic, copy, readonly, nullable) NSArray<SDLSoftButtonCapabilities *> *softButtonCapabilities;
var softButtonCapabilities: [SDLSoftButtonCapabilities]? { get }
See
SDLButtonCapabilitiesOptional, Array of length 1 - 100, of SDLButtonCapabilities
@property (nonatomic, copy, readonly, nullable) NSArray<SDLButtonCapabilities *> *buttonCapabilities;
var buttonCapabilities: [SDLButtonCapabilities]? { get }
If returned, the platform supports custom on-screen Presets
See
SDLPresetBankCapabilitiesOptional
@property (nonatomic, strong, readonly, nullable) SDLPresetBankCapabilities *presetBankCapabilities;
var presetBankCapabilities: SDLPresetBankCapabilities? { get }
See
SDLHMIZoneCapabilitiesOptional, Array of length 1 - 100, of SDLHMIZoneCapabilities
@property (nonatomic, copy, readonly, nullable) NSArray<SDLHMIZoneCapabilities> *hmiZoneCapabilities;
var hmiZoneCapabilities: [SDLHMIZoneCapabilities]? { get }
See
SDLSpeechCapabilitiesOptional, Array of length 1 - 100, of SDLSpeechCapabilities
@property (nonatomic, copy, readonly, nullable) NSArray<SDLSpeechCapabilities> *speechCapabilities;
var speechCapabilities: [SDLSpeechCapabilities]? { get }
See
SDLPrerecordedSpeechOptional, Array of length 1 - 100, of SDLPrerecordedSpeech
@property (nonatomic, copy, readonly, nullable) NSArray<SDLPrerecordedSpeech> *prerecordedSpeechCapabilities;
var prerecordedSpeechCapabilities: [SDLPrerecordedSpeech]? { get }
See
SDLVRCapabilitiesTrue if the head unit supports voice recognition; false if not.
@property (nonatomic, readonly) BOOL vrCapability;
var vrCapability: Bool { get }
See
SDLAudioPassThruCapabilitiesOptional, Array of length 1 - 100, of SDLAudioPassThruCapabilities
@property (nonatomic, copy, readonly, nullable) NSArray<SDLAudioPassThruCapabilities *> *audioPassThruCapabilities;
var audioPassThruCapabilities: [SDLAudioPassThruCapabilities]? { get }
See
SDLAudioPassThruCapabilitiesOptional, Array of length 1 - 100, of SDLAudioPassThruCapabilities
@property (nonatomic, strong, readonly, nullable) SDLAudioPassThruCapabilities *pcmStreamCapability;
var pcmStreamCapability: SDLAudioPassThruCapabilities? { get }
If returned, the platform supports app services
@property (nonatomic, strong, readonly, nullable) SDLAppServicesCapabilities *appServicesCapabilities;
var appServicesCapabilities: SDLAppServicesCapabilities? { get }
If returned, the platform supports navigation
@property (nonatomic, strong, readonly, nullable) SDLNavigationCapability *navigationCapability;
var navigationCapability: SDLNavigationCapability? { get }
If returned, the platform supports making phone calls
@property (nonatomic, strong, readonly, nullable) SDLPhoneCapability *phoneCapability;
var phoneCapability: SDLPhoneCapability? { get }
If returned, the platform supports video streaming
@property (nonatomic, strong, readonly, nullable) SDLVideoStreamingCapability *videoStreamingCapability;
var videoStreamingCapability: SDLVideoStreamingCapability? { get }
If returned, the platform supports remote control capabilities
@property (nonatomic, strong, readonly, nullable) SDLRemoteControlCapabilities *remoteControlCapability;
var remoteControlCapability: SDLRemoteControlCapabilities? { get }
If returned, the platform supports remote control capabilities for seats
@property (nonatomic, strong, readonly, nullable) SDLSeatLocationCapability *seatLocationCapability;
var seatLocationCapability: SDLSeatLocationCapability? { get }
If returned, the platform supports driver distraction capabilities
@property (nonatomic, strong, readonly, nullable) SDLDriverDistractionCapability *driverDistractionCapability;
var driverDistractionCapability: SDLDriverDistractionCapability? { get }
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.
@property (nonatomic, strong, readonly, nullable) SDLWindowCapability *defaultMainWindowCapability;
var defaultMainWindowCapability: SDLWindowCapability? { get }
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.
@property (nonatomic, readonly) BOOL supportsSubscriptions;
var supportsSubscriptions: Bool { get }
Init is unavailable. Dependencies must be injected using initWithConnectionManager:
- (nonnull instancetype)init;
nil
Creates a new system capability manager with a specified connection manager
- (nonnull instancetype)initWithConnectionManager:
(nonnull id<SDLConnectionManagerType>)manager;
A connection manager to use to forward on RPCs
An instance of SDLSystemCapabilityManager
Starts the manager. This method is used internally.
- (void)start;
func start()
Stops the manager. This method is used internally.
- (void)stop;
func stop()
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).
- (nullable SDLWindowCapability *)windowCapabilityWithWindowID:
(NSUInteger)windowID;
func windowCapability(withWindowID windowID: UInt) -> SDLWindowCapability?
The ID of the window from which to get capabilities @returns The window capabilities of the window with the specified windowID, or nil if the window is not known or no window capabilities exist.
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.
- (BOOL)isCapabilitySupported:(nonnull SDLSystemCapabilityType)type;
func isCapabilitySupported(type: SDLSystemCapabilityType) -> Bool
The SystemCapabilityType that will be checked.
Whether or not type
is supported by the connected head unit.
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
).
- (void)updateCapabilityType:(nonnull SDLSystemCapabilityType)type
completionHandler:(nonnull SDLUpdateCapabilityHandler)handler;
func updateCapabilityType(_ type: SDLSystemCapabilityType) async throws -> SDLSystemCapabilityManager
The type of capability to retrieve
The handler to be called when the retrieval is complete
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.
- (nullable id<NSObject>)
subscribeToCapabilityType:(nonnull SDLSystemCapabilityType)type
withUpdateHandler:
(nonnull SDLCapabilityUpdateWithErrorHandler)handler;
func subscribe(capabilityType type: SDLSystemCapabilityType, updateHandler handler: @escaping SDLCapabilityUpdateWithErrorHandler) -> NSObjectProtocol?
The type of capability to subscribe to
The block to be called when the capability is updated with an error if one occurs
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).
Subscribe to a particular capability type with a selector callback.
The selector supports the following parameters:
No parameters e.g. - (void)phoneCapabilityUpdated;
One SDLSystemCapability *
parameter, e.g. - (void)phoneCapabilityUpdated:(SDLSystemCapability *)capability
Two parameters, one SDLSystemCapability *
parameter, and one NSError
parameter, e.g. - (void)phoneCapabilityUpdated:(SDLSystemCapability *)capability error:(NSError *)error
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.
- (BOOL)subscribeToCapabilityType:(nonnull SDLSystemCapabilityType)type
withObserver:(nonnull id)observer
selector:(nonnull SEL)selector;
func subscribe(toCapabilityType type: SDLSystemCapabilityType, withObserver observer: Any, selector: Selector) -> Bool
The type of the system capability to subscribe to
The object that will have selector
called whenever the capability is updated
The selector on observer
that will be called whenever the capability is updated
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.
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.
- (void)unsubscribeFromCapabilityType:(nonnull SDLSystemCapabilityType)type
withObserver:(nonnull id)observer;
func unsubscribe(fromCapabilityType type: SDLSystemCapabilityType, withObserver observer: Any)
The type of the system capability to unsubscribe from
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.