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
JavaScript Suite Documentation
CustomTransport

CustomTransport Class Reference

Constructors

Instance Methods

Constructors

new CustomTransport(transportConfig, transportCallback)

Initializes an instance of CustomTransport.

Instance Methods

customTransport.onByteBufferReceived(message)

A byte buffer was passed here for processing

Kind: Instance method of CustomTransport

ParamTypeDescription
message Uint8Array A message to process

customTransport.onError()

Triggers the transport callback for an error

Kind: Instance method of CustomTransport

customTransport.onSendPacket(bytes)

The app instantiating this class needs to implement this method! sendPacket calls this method

Kind: Instance method of CustomTransport

ParamTypeDescription
bytes UInt8Array the byte array to send via the transport.

customTransport.sendPacket(packet) ⇒ CustomTransport

Sends a packet through the transport

Kind: Instance method of CustomTransport
Returns: CustomTransport - Returns the class instance to allow method chaining.

ParamTypeDescription
packet _SdlPacket An _SdlPacket to send.

customTransport.setTransportCallback(callback) ⇒ CustomTransport

Sets the transport callback function, which is triggered at a later time.

Kind: Instance method of CustomTransport
Returns: CustomTransport - Returns the class instance to allow method chaining.

ParamTypeDescription
callback TransportCallback A TransportCallback.

customTransport.start()

Triggers the transport callback for connection established

Kind: Instance method of CustomTransport

customTransport.stop()

Triggers the transport callback for connection terminated

Kind: Instance method of CustomTransport

View on GitHub.com
Previous Section Next Section