Sample 2 - Global Caché serial signals

This sample shows how to send serial signals to a device, using a Global Caché extender.

Back to sample list

Click here for sample specific documentation

General GC parameters

Global Caché ip address
Global Caché port
Serial module ser1 ser2

Note : about the port

To send serial commands to a Global Caché extender, by default you have to use ports 4999 (ser1) and 5000 (ser2).
If you have modified the port of the extender through its web interface, the serial port is available at <ir port> + 1 and <ir port> + 2.
When you use the gc class, this is taken care of for you, so you only have to specify the ir port.

Bose V30 Volume

This command allows to set the volume of a Bose Lifestyle up to 48, and V20 and V30 series
The Set Volume button reads the value of the first text box, sends it to the Bose system. The Get Volume button reads the current value from the Bose system.

The next samples show how to send an arbitrary serial command to the ser1 or ser2 port (see radio buttons above).
The response is printed below the button

Serial command, no hexadecimal input


The next three examples use an input field and a hexadecimal command string

In this case, the value from the input field must be converted, because otherwise the value is encoded incorrectly.

Serial command from input field, hexadecimal input using the \x construct


Serial command from input field, hexadecimal input using the % construct

Serial command from input field, hexadecimal input using the 0x construct

Serial command, hexadecimal input directly from javascript. No conversion is necessary here

General serial command 4 : \x0B\x00\x01\x04\xA0\x01\x64\x00\x00\x00\xCB

Output