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

Class SdlProtocol

Hierarchy

java.lang.Object

Package
com.smartdevicelink.protocol

Fields

V1_HEADER_SIZE

public static final int V1_HEADER_SIZE
Constant Value
8

V2_HEADER_SIZE

public static final int V2_HEADER_SIZE
Constant Value
12

V1_V2_MTU_SIZE

public static final int V1_V2_MTU_SIZE
Constant Value
1500

V3_V4_MTU_SIZE

public static final int V3_V4_MTU_SIZE
Constant Value
131072

Constructors

SdlProtocol( ISdlProtocol iSdlProtocol, MultiplexTransportConfig config )

public SdlProtocol(ISdlProtocol iSdlProtocol,MultiplexTransportConfig config)

Parameters

iSdlProtocol
config

Methods

start()

public void start()

getMtu()

Retrieves the max payload size for a packet to be sent to the module

public int getMtu()

getMtu( SessionType type )

public long getMtu(SessionType type)

Parameters

type

isConnected()

public boolean isConnected()

reset()

Resets the protocol to init status

protected void reset()

printActiveTransports()

For logging purposes, prints active services on each connected transport

protected void printActiveTransports()

printSecondaryTransportDetails( java.util.List<java.lang.String> secondary, java.util.List<java.lang.Integer> audio, java.util.List<java.lang.Integer> video )

protected void printSecondaryTransportDetails(java.util.List<java.lang.String> secondary,java.util.List<java.lang.Integer> audio,java.util.List<java.lang.Integer> video)

Parameters

secondary
audio
video

isTransportForServiceAvailable( SessionType serviceType )

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

public boolean isTransportForServiceAvailable(SessionType serviceType)

Parameters

serviceType
the session that should be checked for transport availability

getProtocolVersion()

public com.smartdevicelink.util.Version getProtocolVersion()

setVersion( byte version )

This method will set the major protocol version that we should use. It will also set the default MTU based on version.

protected void setVersion(byte version)

Parameters

version
major version to use

endSession( byte sessionID, int hashId )

public void endSession(byte sessionID,int hashId)

Parameters

sessionID
hashId

sendPacket( SdlPacket packet )

public void sendPacket(SdlPacket packet)

Parameters

packet

sendMessage( ProtocolMessage protocolMsg )

public void sendMessage(ProtocolMessage protocolMsg)

Parameters

protocolMsg

handlePacketReceived( SdlPacket packet )

protected void handlePacketReceived(SdlPacket packet)

Parameters

packet

getFrameAssemblerForFrame( SdlPacket packet )

protected com.smartdevicelink.protocol.SdlProtocol.MessageFrameAssembler getFrameAssemblerForFrame(SdlPacket packet)

Parameters

packet

startService( SessionType serviceType, byte sessionID, boolean isEncrypted )

public void startService(SessionType serviceType,byte sessionID,boolean isEncrypted)

Parameters

serviceType
sessionID
isEncrypted

endService( SessionType serviceType, byte sessionID )

public void endService(SessionType serviceType,byte sessionID)

Parameters

serviceType
sessionID

handlePacketToSend( SdlPacket packet )

SdlPacket should have included payload at this point.

protected void handlePacketToSend(SdlPacket packet)

Parameters

packet
packet that will be sent to the router service

handleServiceEndedNAK( SdlPacket packet, SessionType serviceType )

This method handles the end of a protocol session. A callback is sent to the protocol listener.

protected void handleServiceEndedNAK(SdlPacket packet,SessionType serviceType)

Parameters

packet
serviceType

handleServiceEnded( SdlPacket packet, SessionType sessionType )

protected void handleServiceEnded(SdlPacket packet,SessionType sessionType)

Parameters

packet
sessionType

handleProtocolSessionStarted( SdlPacket packet, SessionType serviceType )

This method handles the startup of a protocol session. A callback is sent to the protocol listener.

protected void handleProtocolSessionStarted(SdlPacket packet,SessionType serviceType)

Parameters

packet
StarServiceACK packet
serviceType
the service type that has just been started

handleProtocolSessionNAKed( SdlPacket packet, SessionType serviceType )

protected void handleProtocolSessionNAKed(SdlPacket packet,SessionType serviceType)

Parameters

packet
serviceType

handleProtocolError( String string, Exception ex )

protected void handleProtocolError(String string,Exception ex)

Parameters

string
ex

handleProtocolHeartbeat( SessionType sessionType, byte sessionID )

protected void handleProtocolHeartbeat(SessionType sessionType,byte sessionID)

Parameters

sessionType
sessionID

handleServiceDataACK( SdlPacket packet, SessionType sessionType )

protected void handleServiceDataACK(SdlPacket packet,SessionType sessionType)

Parameters

packet
sessionType

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