Slip serial communication example – AMX UDM-0404 User Manual

Page 94

Advertising
background image

UDM Hub Control Protocol

82

UDM-0404 4x4 Multi-Format Distribution Hub

The following example shows SLIP encoding for a UDP packet, showing the start and end characters (192)
and substitution of special sequences when the data includes the start and end characters:

Responses which are SLIP framed will require decoding at the host.

SLIP Serial Communication Example

Typically, host systems may not provide support for SLIP encapsulation, so the host must use the normal
mechanism for sending serial characters, and add the encapsulation. For most commands, this just consists of
adding a 192 character to the beginning of the serial command and one at the end.

For example, assuming that the host has a function call to send a serial character of SendChar() (this will vary
from system to system), then the switching example in 1.2 above would become:

SendChar(192); // send begin character

SendChar(1); // send command value

SendChar(0); // send first parameter (user defined)

SendChar(1); // send second parameter (port number)

SendChar(2); // send third parameter (input number)

SendChar(1); // send fourth parameter (sub input number)

SendChar(0); // send fifth parameter (input type)

SendChar(192); // send end character

The hub would reply with eight serial characters, six for the reply described in this document, together with the
SLIP encapsulation characters of 192 at the beginning and 192 at the end i.e the hub reply string would look
like:

Similarly, the login example in 1.3 above would result in the following. In this example, we have assumed that
the SendChar() command in the host can accept an ASCII value in quotes as well as a decimal number:

SendChar(192); // send begin character

SendChar(98); // send command value

SendChar(0); // send first parameter (user defined)

SendChar(5); // send second parameter (password length)

SendChar('a'); // send third parameter (first character in password)

SendChar('d'); // send fourth parameter (second password character)

SendChar('m'); // send fifth parameter (third password character)

SendChar('i'); // send sixth parameter (fourth password character)

SendChar('n'); // send seventh parameter (fifth password character)

SendChar(192); // send end character

UDP data

17

03

192

69

219

25

SLIP data

192

17

03

219

220

69

219

221

25

192

Byte #

Value

Description

0

192 (equivalent C0 hex) SLIP begin character

1

1

Returned command value

2

1

Status (success)

3

1

Returned port number

4

2

Returned input number

5

1

Returned sub input number

6

0

Returned input type

7

192

SLIP end character

Advertising