Target Communication Framework Services - PortServer

PortServer Service

Version History

Version Date Change
0.1 2016-07-10 Initial contribution

Overview

PortServer service provides ability to create a TCP/UDP port server on the TCF peer host to connect to a local TCP/UDP/serial port. The PortServer service is built on top of the PortForward service; when a port server is created, the TCF channel used to transmit the command will be the one used to send the PortForward commands.

When a TCF client connect to a TCF peer and create a port server, the TCF peer will create a local TCP or UDP server (depending on the parameters) and will use the PortForward service to link this port to the corresponding port on the TCF client (the one that has sent the PortServer command). At this point, all the data that is written to the port server will be sent to the port opened by PortForward service and vice-versa. In case of a TCP server, the PortForward command will be sent to the TCF client only when a connection request is sent to the server (unless the AutoConnect parameter is set); in case of a UDP server it is sent as soon as the PortServer is created.

If the PortServer service is processed by a value-add, then the PortForward commands are not sent to the TCF client (the one that has issued the request) but instead are sent to the TCF peers (the one connected to through the value-add).

Command are encoded as zero terminated JSON strings.

The service uses standard format for error reports, see Error Report Format.

Commands

getConfig

C • <token> • PortServer • getConfig • <string: Port ServerID> •

The command retrieves information for given Port Server configuration ID.

Reply:

R • <token> • <error report> • <Port Server properties> • <port server properties>

Port Forward properties consists of a list of status properties.

Predefined properties are:

list

C • <token> • PortServer • list•

The command list available Port Server IDs

Reply:


<array of Port Server IDs>
    ⇒ null
    ⇒ [ ]
    ⇒ [ <Port Servers ID list> ]

<Port Servers ID list><string: Port Forward ID><Port Server ID list> , <string: Port Server ID>

create


C • <token> • PortServer • create • <Port Server configuration> •

<
Port Server configuration><object>

The command creates a Port Server with specified properties.

Predefined properties are:

Reply:

R • <token> • <error report> • <port server properties> •
<port server properties>
    ⇒ null
    ⇒ <object>

Port properties are the same as returned by the getConfig command.

delete


C • <token> • PortServer • delete • <string: PortServer ID> •

The command deletes a previously created Port Foward connection.

Reply:


R • <token> • <error report> •

getCapabilities


C • <token> • PortServer • getCapabilities • <string: PortServer ID> •

This command retrieves PortServer service capabilities to clients so they can adjust to different implementations of the service. Currently, only a null ("") PortServer ID is supported.

Reply:

R • <token> • <error report> • <service capabilities> •

<service capabilities>

    ⇒ <object>

Service capabilities consist of a list of properties. All properties are optional. Tools and targets can define additional properties. No predefined properties exist yet.

Events

PortServer service does not currently have any event