Port Send

Command Code:

Binary: [p2 p1 p0 l4 l3 l2 l1 l0] [byte 1] [byte 2] … [byte L]


Send data out the specified port. Bits p2:p0 form the port number P which maps to the following ports:

P = 0 0 0     S-Link port 0
P = 0 0 1     S-Link port 1
P = 0 1 0     S-Link port 2
P = 0 1 1     S-Link port 3
P = 1 0 0     IR port(s)
P = 1 0 1     Parallel Port
P = 1 1 0     Serial Port
P = 1 1 1     System

Bits l4:l0 form the number L which indicates the length of the  message to be sent out the port in bytes. The L bytes following the command contain the message. The values L=0 and L=31 are reserved for the port send end and port modify messages respectively.

IR port messages are sent in a run length coded format while S-Link  and Parallel Port messages are sent in a raw binary format. While S-Link messages are typically shorter than 30 bytes, many IR messages can be longer than 30 bytes using the run length coded format. To allow messages of arbitrary size to be sent and received by the Slink-e, multiple port send commands can be sent in succession. It is important to recognize that the Slink-e must receive these port send commands in a timely manner for them to form a continuous message signal. If the Slink-e doesn't receive the message data in time, a transmission timeout error will occur. In order to indicate the end of a port transmission, a port send end command must always be sent at the end of a message, otherwise a transmission timeout error will occur. The Slink-e can only send messages to one port at a time. DO NOT intermix port send messages to different ports without first sending a port send end. An additional feature has been added which allows "sending" characters to the serial port. These characters are placed directly back into the Slink-e's output buffer and are echoed back to the host. This is useful for testing RS-232 integrity or to emulate Slink-e responses for software testing.

The Slink-e begins sending the port message as soon as it receives the first data byte unless:

  1. There is already an outgoing message in progress (on any port).
  2. There is an incoming message on the port you are trying to send the message on. (S-Link only)

In either case, Slink-e begins sending the message as soon as (1) and (2) aren't true. Not sending during incoming messages on the same port allows Slink-e to prevent a collision from occurring on the S-Link bus.