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
Android Documentation
BaseSdlSession

Class BaseSdlSession

Hierarchy

java.lang.Object

Package
com.smartdevicelink.session
All Implemented Interfaces
com.smartdevicelink.protocol.ISdlProtocol, com.smartdevicelink.security.ISecurityInitializedListener
All Known Subclasses
com.smartdevicelink.session.SdlSession

Quick Jump

Fields
Constructors
Methods

Fields

sdlProtocol

protected final com.smartdevicelink.protocol.SdlProtocolBase sdlProtocol

transportConfig

protected final com.smartdevicelink.transport.BaseTransportConfig transportConfig

sessionListener

protected com.smartdevicelink.session.ISdlSessionListener sessionListener

sdlSecurity

protected com.smartdevicelink.security.SdlSecurityBase sdlSecurity

desiredVideoParams

protected com.smartdevicelink.streaming.video.VideoStreamingParameters desiredVideoParams

acceptedVideoParams

protected com.smartdevicelink.streaming.video.VideoStreamingParameters acceptedVideoParams

sessionId

protected int sessionId

serviceListeners

protected java.util.HashMap serviceListeners

encryptedServices

protected final java.util.concurrent.CopyOnWriteArrayList encryptedServices

Constructors

BaseSdlSession( ISdlSessionListener listener, BaseTransportConfig config )

public BaseSdlSession(ISdlSessionListener listener,BaseTransportConfig config)

Constructor Parameters

listener
config

Methods

getSdlProtocolImplementation()

protected abstract com.smartdevicelink.protocol.SdlProtocolBase getSdlProtocolImplementation()

getMtu()

public int getMtu()

getMtu( SessionType type )

public long getMtu(SessionType type)

Method Parameters

type

close()

public void close()

startService( SessionType serviceType, boolean isEncrypted )

public void startService(SessionType serviceType,boolean isEncrypted)

Method Parameters

serviceType
isEncrypted

endService( SessionType serviceType )

public void endService(SessionType serviceType)

Method Parameters

serviceType

startSession()

public void startSession() throws com.smartdevicelink.exception.SdlException

Throws

sendMessage( ProtocolMessage msg )

public void sendMessage(ProtocolMessage msg)

Method Parameters

msg

getCurrentTransportType()

public com.smartdevicelink.transport.enums.TransportType getCurrentTransportType()

getIsConnected()

public boolean getIsConnected()

getProtocolVersion()

Get the current protocol version used by this session

public com.smartdevicelink.util.Version getProtocolVersion()

getTransportConfig()

public com.smartdevicelink.transport.BaseTransportConfig getTransportConfig()

setSdlSecurity( SdlSecurityBase sec )

public void setSdlSecurity(SdlSecurityBase sec)

Method Parameters

sec

processControlService( ProtocolMessage msg )

protected void processControlService(ProtocolMessage msg)

Method Parameters

msg

extractSystemInfo( SdlPacket packet )

Extracts the SystemInfo out of a packet

protected com.smartdevicelink.util.SystemInfo extractSystemInfo(SdlPacket packet)

Method Parameters

packet
should be a StartServiceACK for the RPC service

isServiceProtected( SessionType sType )

public boolean isServiceProtected(SessionType sType)

Method Parameters

sType

addServiceListener( SessionType serviceType, ISdlServiceListener sdlServiceListener )

public void addServiceListener(SessionType serviceType,ISdlServiceListener sdlServiceListener)

Method Parameters

serviceType
sdlServiceListener

removeServiceListener( SessionType serviceType, ISdlServiceListener sdlServiceListener )

public boolean removeServiceListener(SessionType serviceType,ISdlServiceListener sdlServiceListener)

Method Parameters

serviceType
sdlServiceListener

getServiceListeners()

public java.util.HashMap getServiceListeners()

setDesiredVideoParams( VideoStreamingParameters params )

public void setDesiredVideoParams(VideoStreamingParameters params)

Method Parameters

params

getAcceptedVideoParams()

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

onProtocolMessageReceived( ProtocolMessage msg )

public void onProtocolMessageReceived(ProtocolMessage msg)

Method Parameters

msg

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

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

Method Parameters

packet
sessionType
sessionID
version
isEncrypted

onServiceEnded( SdlPacket packet, SessionType sessionType, int sessionID )

public abstract void onServiceEnded(SdlPacket packet,SessionType sessionType,int sessionID)

Method Parameters

packet
sessionType
sessionID

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

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

Method Parameters

packet
sessionType
sessionID
error

onProtocolError( String info, Exception e )

public void onProtocolError(String info,Exception e)

Method Parameters

info
e

getSessionId()

public int getSessionId()

shutdown( String info )

public void shutdown(String info)

Method Parameters

info

onTransportDisconnected( String info, boolean altTransportAvailable, BaseTransportConfig transportConfig )

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

Method Parameters

info
altTransportAvailable
transportConfig

getSdlSecurity()

public com.smartdevicelink.security.SdlSecurityBase getSdlSecurity()

getDesiredVideoParams()

Returns the currently set desired video streaming parameters. If there haven't been any set, the default options will be returned and set for this instance.

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

setAcceptedVideoParams( VideoStreamingParameters params )

public void setAcceptedVideoParams(VideoStreamingParameters params)

Method Parameters

params

onAuthTokenReceived( String authToken )

public void onAuthTokenReceived(String authToken)

Method Parameters

authToken

onSecurityInitialized()

public void onSecurityInitialized()

isTransportForServiceAvailable( SessionType sessionType )

Check to see if a transport is available to start/use the supplied service.

public boolean isTransportForServiceAvailable(SessionType sessionType)

Method Parameters

sessionType
the session that should be checked for transport availability

getActiveTransports()

Retrieves list of the active transports

public java.util.List getActiveTransports()

Inherited Methods

From Class Methods
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section