Class SdlProtocolBase
Hierarchy
java.lang.Object
- Package
- com.smartdevicelink.protocol
Quick Jump
- Fields
-
- Constructors
-
- Methods
-
- start()
- getMtu()
- getMtu(SessionType type)
- resetSession() Deprecated
- isConnected()
- reset()
- printActiveTransports()
- printSecondaryTransportDetails(java.util.List<java.lang.String> secondary,java.util.List<java.lang.Integer> audio,java.util.List<java.lang.Integer> video)
- isTransportForServiceAvailable(SessionType serviceType)
- getProtocolVersion()
- setVersion(byte version)
- endSession(byte sessionID)
- sendMessage(ProtocolMessage protocolMsg)
- handlePacketReceived(SdlPacket packet)
- getFrameAssemblerForFrame(SdlPacket packet)
- startService(SessionType serviceType,byte sessionID,boolean isEncrypted)
- endService(SessionType serviceType,byte sessionID)
- handlePacketToSend(SdlPacket packet)
- handleServiceEndedNAK(SdlPacket packet,SessionType serviceType)
- handleServiceEnded(SdlPacket packet,SessionType sessionType)
- handleStartServiceACK(SdlPacket packet,SessionType serviceType)
- handleProtocolSessionNAKed(SdlPacket packet,SessionType serviceType)
- handleProtocolError(String string,Exception ex)
- handleProtocolHeartbeat(SessionType sessionType,byte sessionID)
- getActiveTransports()
Fields
public static final int V1_HEADER_SIZE
- Constant Value
- 8
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
SdlProtocolBase(
ISdlProtocol iSdlProtocol,
BaseTransportConfig config
)
public SdlProtocolBase(ISdlProtocol iSdlProtocol,BaseTransportConfig config)
Constructor Parameters
- iSdlProtocol
- config
Methods
getMtu()
Retrieves the max payload size for a packet to be sent to the module
getMtu(
SessionType type
)
public long getMtu(SessionType type)
Method Parameters
- type
resetSession()
Deprecated
public void resetSession()
isConnected()
public boolean isConnected()
reset()
Resets the protocol to init status
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)
Method 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)
Method 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)
Method Parameters
- version
- major version to use
endSession(
byte sessionID
)
public void endSession(byte sessionID)
Method Parameters
- sessionID
sendMessage(
ProtocolMessage protocolMsg
)
public void sendMessage(ProtocolMessage protocolMsg)
Method Parameters
- protocolMsg
handlePacketReceived(
SdlPacket packet
)
protected void handlePacketReceived(SdlPacket packet)
Method Parameters
- packet
getFrameAssemblerForFrame(
SdlPacket packet
)
protected com.smartdevicelink.protocol.SdlProtocolBase.MessageFrameAssembler getFrameAssemblerForFrame(SdlPacket packet)
Method Parameters
- packet
startService(
SessionType serviceType,
byte sessionID,
boolean isEncrypted
)
public void startService(SessionType serviceType,byte sessionID,boolean isEncrypted)
Method Parameters
- serviceType
- sessionID
- isEncrypted
endService(
SessionType serviceType,
byte sessionID
)
public void endService(SessionType serviceType,byte sessionID)
Method Parameters
- serviceType
- sessionID
handlePacketToSend(
SdlPacket packet
)
SdlPacket should have included payload at this point.
protected void handlePacketToSend(SdlPacket packet)
Method 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)
Method Parameters
- packet
- serviceType
handleServiceEnded(
SdlPacket packet,
SessionType sessionType
)
protected void handleServiceEnded(SdlPacket packet,SessionType sessionType)
Method Parameters
- packet
- sessionType
handleStartServiceACK(
SdlPacket packet,
SessionType serviceType
)
This method handles the startup of a protocol session. A callback is sent
to the protocol listener.
protected void handleStartServiceACK(SdlPacket packet,SessionType serviceType)
Method 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)
Method Parameters
- packet
- serviceType
handleProtocolError(
String string,
Exception ex
)
protected void handleProtocolError(String string,Exception ex)
Method Parameters
- string
- ex
handleProtocolHeartbeat(
SessionType sessionType,
byte sessionID
)
protected void handleProtocolHeartbeat(SessionType sessionType,byte sessionID)
Method Parameters
- sessionType
- sessionID
getActiveTransports()
This method will return copy of 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