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

SDLManager Class Reference

Section Contents

Overview

Undocumented

configuration

The configuration the manager was set up with.

Objective-C

@property (readonly, copy, nonatomic) SDLConfiguration *_Nonnull configuration;

Swift

@NSCopying var configuration: SDLConfiguration { get }

hmiLevel

The current HMI level of the running app.

Objective-C

@property (readonly, copy, nonatomic, nullable) SDLHMILevel hmiLevel;

Swift

var hmiLevel: SDLHMILevel? { get }

audioStreamingState

The current audio streaming state of the running app.

Objective-C

@property (readonly, copy, nonatomic)
    SDLAudioStreamingState _Nonnull audioStreamingState;

Swift

var audioStreamingState: SDLAudioStreamingState { get }

systemContext

The current system context of the running app.

Objective-C

@property (readonly, copy, nonatomic) SDLSystemContext _Nonnull systemContext;

Swift

var systemContext: SDLSystemContext { get }

fileManager

The file manager to be used by the running app.

Objective-C

@property (readonly, strong, nonatomic) SDLFileManager *_Nonnull fileManager;

Swift

var fileManager: SDLFileManager { get }

permissionManager

The permission manager monitoring RPC permissions.

Objective-C

@property (readonly, strong, nonatomic)
    SDLPermissionManager *_Nonnull permissionManager;

Swift

var permissionManager: SDLPermissionManager { get }

streamManager

The streaming media manager to be used for starting video sessions.

Objective-C

@property (readonly, strong, nonatomic, nullable)
    SDLStreamingMediaManager *streamManager;

Swift

var streamManager: SDLStreamingMediaManager? { get }

screenManager

The screen manager for sending UI related RPCs.

Objective-C

@property (readonly, strong, nonatomic) SDLScreenManager *_Nonnull screenManager;

Swift

var screenManager: SDLScreenManager { get }

systemCapabilityManager

Centralized manager for retrieving all system capabilities.

Objective-C

@property (readonly, strong, nonatomic)
    SDLSystemCapabilityManager *_Nonnull systemCapabilityManager;

Swift

var systemCapabilityManager: SDLSystemCapabilityManager { get }

registerResponse

The response of a register call after it has been received.

Objective-C

@property (readonly, strong, nonatomic, nullable)
    SDLRegisterAppInterfaceResponse *registerResponse;

Swift

var registerResponse: SDLRegisterAppInterfaceResponse? { get }

delegate

The manager’s delegate.

Objective-C

@property (readwrite, nonatomic, nullable) id<SDLManagerDelegate> delegate;

pendingRPCTransactions

The currently pending RPC request send transactions

Objective-C

@property (readonly, copy, nonatomic)
    NSArray<__kindof NSOperation *> *_Nonnull pendingRPCTransactions;

Swift

var pendingRPCTransactions: [Operation] { get }

proxy

Undocumented

Objective-C

@property (strong, nonatomic, readonly, nullable) SDLProxy *proxy

Swift

var proxy: SDLProxy? { get }

-initWithConfiguration:delegate:

Initialize the manager with a configuration. Call startWithHandler to begin waiting for a connection.

Objective-C

- (nonnull instancetype)
initWithConfiguration:(nonnull SDLConfiguration *)configuration
             delegate:(nullable id<SDLManagerDelegate>)delegate;

Parameters

configuration

Your app’s unique configuration for setup.

delegate

An optional delegate to be notified of hmi level changes and startup and shutdown. It is recommended that you implement this.

Return Value

An instance of SDLManager

-startWithReadyHandler:

Start the manager, which will tell it to start looking for a connection. Once one does, it will automatically run the setup process and call the readyBlock when done.

Objective-C

- (void)startWithReadyHandler:(nonnull SDLManagerReadyBlock)readyHandler;

Swift

func start(readyHandler: @escaping SDLManagerReadyBlock)

Parameters

readyHandler

The block called when the manager is ready to be used or an error occurs while attempting to become ready.

-stop

Stop the manager, it will disconnect if needed and no longer look for a connection. You probably don’t need to call this method ever.

If you do call this method, you must wait for SDLManagerDelegate’s managerDidDisconnect callback to call startWithReadyHandler:.

Objective-C

- (void)stop;

Swift

func stop()

-sendRequest:

Send an RPC request and don’t bother with the response or error. If you need the response or error, call sendRequest:withCompletionHandler: instead.

Objective-C

- (void)sendRequest:(nonnull SDLRPCRequest *)request;

Swift

func send(_ request: SDLRPCRequest)

Parameters

request

The RPC request to send

-sendRequest:withResponseHandler:

Send an RPC request and set a completion handler that will be called with the response when the response returns.

Objective-C

- (void)sendRequest:(nonnull SDLRPCRequest *)request
    withResponseHandler:(nullable SDLResponseHandler)handler;

Swift

func send(request: SDLRPCRequest, responseHandler handler: SDLResponseHandler? = nil)

Parameters

request

The RPC request to send

handler

The handler that will be called when the response returns

-sendRequests:progressHandler:completionHandler:

Send all of the requests given as quickly as possible, but in order. Call the completionHandler after all requests have either failed or given a response.

Objective-C

- (void)sendRequests:(nonnull NSArray<SDLRPCRequest *> *)requests
      progressHandler:
          (nullable SDLMultipleAsyncRequestProgressHandler)progressHandler
    completionHandler:
        (nullable SDLMultipleRequestCompletionHandler)completionHandler;

Swift

func send(_ requests: [SDLRPCRequest], progressHandler: SDLMultipleAsyncRequestProgressHandler?, completionHandler: SDLMultipleRequestCompletionHandler? = nil)

Parameters

requests

The requests to be sent

progressHandler

A handler called every time a response is received

completionHandler

A handler to call when all requests have been responded to

-sendSequentialRequests:progressHandler:completionHandler:

Send all of the requests one at a time, with the next one going out only after the previous one has received a response. Call the completionHandler after all requests have either failed or given a response.

Objective-C

- (void)
sendSequentialRequests:(nonnull NSArray<SDLRPCRequest *> *)requests
       progressHandler:
           (nullable SDLMultipleSequentialRequestProgressHandler)progressHandler
     completionHandler:
         (nullable SDLMultipleRequestCompletionHandler)completionHandler;

Swift

func sendSequential(requests: [SDLRPCRequest], progressHandler: SDLMultipleSequentialRequestProgressHandler?, completionHandler: SDLMultipleRequestCompletionHandler? = nil)

Parameters

requests

The requests to be sent

progressHandler

A handler called every time a response is received. Return NO to cancel any requests that have not yet been sent, YES to continue sending requests.

completionHandler

A handler to call when all requests have been responded to

View on GitHub.com
Previous Section Next Section