public class SdlProtocolBase extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
SdlProtocolBase.MessageFrameAssembler |
| Modifier and Type | Field and Description |
|---|---|
static int |
V1_HEADER_SIZE
Original header size based on version 1.0.0 only
|
static int |
V1_V2_MTU_SIZE |
static int |
V2_HEADER_SIZE
Larger header size that is used by versions 2.0.0 and up
|
static int |
V3_V4_MTU_SIZE |
| Constructor and Description |
|---|
SdlProtocolBase(ISdlProtocol iSdlProtocol,
BaseTransportConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
endService(SessionType serviceType,
byte sessionID) |
void |
endSession(byte sessionID) |
List<TransportRecord> |
getActiveTransports()
This method will return copy of active transports
|
protected SdlProtocolBase.MessageFrameAssembler |
getFrameAssemblerForFrame(SdlPacket packet) |
int |
getMtu()
Retrieves the max payload size for a packet to be sent to the module
|
long |
getMtu(SessionType type) |
Version |
getProtocolVersion() |
protected void |
handlePacketReceived(SdlPacket packet) |
protected void |
handlePacketToSend(SdlPacket packet)
SdlPacket should have included payload at this point.
|
protected void |
handleProtocolError(String string,
Exception ex) |
protected void |
handleProtocolHeartbeat(SessionType sessionType,
byte sessionID) |
protected void |
handleProtocolSessionNAKed(SdlPacket packet,
SessionType serviceType) |
protected void |
handleServiceEnded(SdlPacket packet,
SessionType sessionType) |
protected void |
handleServiceEndedNAK(SdlPacket packet,
SessionType serviceType)
This method handles the end of a protocol session.
|
protected void |
handleStartServiceACK(SdlPacket packet,
SessionType serviceType)
This method handles the startup of a protocol session.
|
boolean |
isConnected() |
boolean |
isTransportForServiceAvailable(SessionType serviceType)
Check to see if a transport is available to start/use the supplied service.
|
protected void |
printActiveTransports()
For logging purposes, prints active services on each connected transport
|
protected void |
printSecondaryTransportDetails(List<String> secondary,
List<Integer> audio,
List<Integer> video) |
protected void |
reset()
Resets the protocol to init status
|
void |
resetSession()
Deprecated.
|
void |
sendMessage(ProtocolMessage protocolMsg) |
protected void |
setVersion(byte version)
This method will set the major protocol version that we should use.
|
void |
start() |
void |
startService(SessionType serviceType,
byte sessionID,
boolean isEncrypted) |
public static final int V1_HEADER_SIZE
public static final int V2_HEADER_SIZE
public static final int V1_V2_MTU_SIZE
public static final int V3_V4_MTU_SIZE
public SdlProtocolBase(@NonNull
ISdlProtocol iSdlProtocol,
@NonNull
BaseTransportConfig config)
public void start()
public int getMtu()
public long getMtu(SessionType type)
@Deprecated public void resetSession()
public boolean isConnected()
protected void reset()
protected void printActiveTransports()
protected void printSecondaryTransportDetails(List<String> secondary, List<Integer> audio, List<Integer> video)
public boolean isTransportForServiceAvailable(@NonNull
SessionType serviceType)
serviceType - the session that should be checked for transport availabilitypublic Version getProtocolVersion()
protected void setVersion(byte version)
version - major version to usepublic void endSession(byte sessionID)
public void sendMessage(ProtocolMessage protocolMsg)
protected void handlePacketReceived(SdlPacket packet)
protected SdlProtocolBase.MessageFrameAssembler getFrameAssemblerForFrame(SdlPacket packet)
public void startService(SessionType serviceType, byte sessionID, boolean isEncrypted)
public void endService(SessionType serviceType, byte sessionID)
protected void handlePacketToSend(SdlPacket packet)
packet - packet that will be sent to the router serviceprotected void handleServiceEndedNAK(SdlPacket packet, SessionType serviceType)
protected void handleServiceEnded(SdlPacket packet, SessionType sessionType)
protected void handleStartServiceACK(SdlPacket packet, SessionType serviceType)
packet - StarServiceACK packetserviceType - the service type that has just been startedprotected void handleProtocolSessionNAKed(SdlPacket packet, SessionType serviceType)
protected void handleProtocolHeartbeat(SessionType sessionType, byte sessionID)
public List<TransportRecord> getActiveTransports()