Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
JavaEE Documentation
ISdlProtocol

Interface ISdlProtocol

Package
com.smartdevicelink.protocol
All Known Implementing Classes
com.smartdevicelink.session.BaseSdlSession

Methods

onProtocolMessageReceived( ProtocolMessage msg )

Called to indicate that a complete message (RPC, BULK, etc.) has been received.

public void onProtocolMessageReceived(ProtocolMessage msg)

Method Parameters

msg
the message that was received

onServiceStarted( SdlPacket packet, SessionType serviceType, int sessionID, Version version, boolean isEncrypted )

Called to indicate that a service has been started

public void onServiceStarted(SdlPacket packet,SessionType serviceType,int sessionID,Version version,boolean isEncrypted)

Method Parameters

packet
the control packet StartServiceACK received from the connected device
serviceType
the service type that has been started
sessionID
the session ID that this service has been started on
version
the protocol version used for this session and service
isEncrypted
if the service is encrypted

onServiceEnded( SdlPacket packet, SessionType serviceType, int sessionID )

This will get called when a service has ended

public void onServiceEnded(SdlPacket packet,SessionType serviceType,int sessionID)

Method Parameters

packet
the packet received that ended this service
serviceType
the service type that has ended
sessionID
the id of the session that this service was operating on

onServiceError( SdlPacket packet, SessionType serviceType, int sessionID, String error )

If there is an error with starting or stopping the service or any other error this method will be called. This will also be called if the service was operating on a transport that has been disconnected.

public void onServiceError(SdlPacket packet,SessionType serviceType,int sessionID,String error)

Method Parameters

packet
if there is a packet that caused this error it will be included, however this can be null.
serviceType
the service type that experienced the error
sessionID
the session ID that this service was associated with
error
a human readable string of the error

onProtocolError( String info, Exception e )

Called to indicate that a protocol error was detected in received data.

public void onProtocolError(String info,Exception e)

Method Parameters

info
a human readable string of the error
e
the exception if one occurred

getSessionId()

Method that the protocol layer will use to obtain the session ID

public int getSessionId()

shutdown( String info )

A request made by the protocol layer to shutdown the layers above it. Likely due to the RPC service being shutdown or the primary transport disconnecting.

public void shutdown(String info)

Method Parameters

info
human readable string on why the shutdown should occur

onTransportDisconnected( String info, boolean altTransportAvailable, BaseTransportConfig transportConfig )

Called when a transport disconnects

public void onTransportDisconnected(String info,boolean altTransportAvailable,BaseTransportConfig transportConfig)

Method Parameters

info
a human readable string including information on the disconnected transport
altTransportAvailable
a boolean flag indicating if there is another transport that can be used to connect with the SDL enabled device.
transportConfig
the previously supplied transport config

getSdlSecurity()

A method that should be implemented by the hosting class of the SdlProtocol instance that will return the currently being used security library if any.

public SdlSecurityBase getSdlSecurity()

getDesiredVideoParams()

A method that should be implemented by the hosting class of the SdlProtocol instance that will return the desired video streaming parameters. These parameters will be requested if another component has requested the video streaming service to start.

public com.smartdevicelink.streaming.video.VideoStreamingParameters getDesiredVideoParams()

setAcceptedVideoParams( VideoStreamingParameters acceptedVideoParams )

A callback that will be called when the video service has been successfully started and the streaming parameters have been negotiated. This should be called prior to the video service started callback.

public void setAcceptedVideoParams(VideoStreamingParameters acceptedVideoParams)

Method Parameters

acceptedVideoParams
the negotiated and accepted video parameters that should be used to stream to the SDL enabled device.

onAuthTokenReceived( String authToken )

A callback to indicate the SDL connected device has supplied an authentication token to this application. It will be called after the service start callback.

public void onAuthTokenReceived(String authToken)

Method Parameters

authToken
View on GitHub.com
Previous Section Next Section