Transport

interface Transport

This class defines the interface for transport that must be implemented to represent the creation and management of an interface.

Functions

Link copied to clipboard
abstract fun connect(): Boolean

Initiate a connection to DeviceGateway.

Link copied to clipboard
abstract fun disconnect()

Disconnect from DeviceGateway.

Link copied to clipboard
open fun handoffConnection(    protocol: String,     hostname: String,     address: String,     port: Int,     retryCountLimit: Int,     connectionTimeout: Int,     charge: String)

handoff connection from SystemCapability

Link copied to clipboard
abstract fun isConnected(): Boolean

Returns whether this object is currently connected to DeviceGateway.

Link copied to clipboard
abstract fun isConnectedOrConnecting(): Boolean

Returns whether this object is currently connecting or connected to DeviceGateway.

Link copied to clipboard
abstract fun newCall(    activeTransport: Transport?,     request: MessageRequest,     headers: Map<String, String>?,     listener: MessageSender.OnSendMessageListener): Call
Link copied to clipboard
abstract fun send(call: Call): Boolean

Send a message request.

Link copied to clipboard
abstract fun shutdown()

Explicitly clean up client resources.

Link copied to clipboard
open fun startDirectivesService()

The server can send some directives at certain times.

Link copied to clipboard
open fun stopDirectivesService()

Stop receiving server-initiated-directive.