Online Manual

FLEX-16pro

2.2.2 API Control

This system supports HTTP and serial control methods.

HTTP Control Method

HTTP Port: 80.

Keep-alive mode is not supported.

Unless otherwise specified, the POST or GET URL for the interfaces below is: http://host_ip_address/index2.html

Login

Request typePOST
ContentJson: { "Command" : "Login", "UserName" : "Username", "Password" : "MD5 string of password" }
ResponseJson: { "Status" : "Ok"/"Error", "SessionId" : Session ID of this login -- valid when status is ok, "ScreenGroup" : [Screen group permissions, 1 = can operate, 0 = cannot operate], "Message" : "Error message" }
📢  Notes 

The session ID must be saved for subsequent use.

Get Host Scene List

This command retrieves the scene list corresponding to the screen group specified by ScreenGroup.

Request typeGET
Header containssession_id=session id
ContentCommand=GetAllModal&ScreenGroup=Screen group number (1~4)
ResponseJson: { "Status":"Ok"/"Error", "ModalList":["Scene Name", "Scene Name", ...] }

Get Host Scene Thumbnail

Request typeGET
URLhttp://xxx.xxx.xxx.xxx/scene_name.jpg
Header containssession_id=session id
ResponseImage data

Switch Scene

Request typePOST
Header containssession_id=session id
ContentJson: { "Command" : "LoadModal", "ScreenGroup" : Screen group number (1~4), "ModalName" : "Scene Name" }
ResponseJson: { "Status" : "Ok"/"Error", "Message" : "Error message" }

Serial Control Method

Serial Configuration

  • Baud Rate: 9600
  • Parity: None
  • Flow Control: None
  • Data Bits: 8
  • Stop Bits: 1

If using RJ45 network cable to connect to the processor serial port, pin 1 is our TX, pin 2 is our RX, pin 6 is our GND; other pins are disconnected. RJ45 pinout diagram is as follows:

(Refer to original document for RJ45 pinout diagram)

If using DB9 serial cable to connect to the processor serial port, pin 3 is our TX, pin 2 is our RX, pin 5 is our GND. DB9 pin definitions are as follows:

(Refer to original document for DB9 pin definition diagram)

Packet Format

Commands sent from the control system to the device, and responses from the device to the control system, are both encapsulated into data packets. Each packet starts with the $ character and ends with the ^ character, as shown below:

Op indicates the operation command, one character.
Scr indicates the screen group number to be operated, one character.

Format: $ Op Scr DATA ^

The processor control system supports both string commands and hexadecimal commands. The control device can send either string commands or hexadecimal commands to the processor, both of which can be processed. Hexadecimal commands are the ASCII codes of the string.

Serial Commands

Get Host Scene List

Op1
ScrOne byte, value 1 to 4, specifying the screen group number
DATANone
ExamplesGet screen group 1 scenes: $11^ Get screen group 2 scenes: $12^ Get screen group 3 scenes: $13^ Get screen group 4 scenes: $14^
Device ResponseOp: 1 DATA: Multiple scene names separated by spaces (UTF8 format). Example: Scene1 Scene2

Get Current Window List

Op2
ScrOne byte, value 1 to 4, specifying the screen group number.
DATANone
ExamplesGet screen group 1 window list: $21^ Get screen group 2 window list: $22^ Get screen group 3 window list: $23^ Get screen group 4 window list: $24^
Device ResponseOp: 2 DATA: Multiple window information separated by brackets, window info format is [WindowID,Top-left X,Top-left Y,Bottom-right X,Bottom-right Y]. Example: 2[21326,0,0,960,540][25588,960,0,1920,540]...[13336,5760,8100,6720,8640][9651,6720,8100,7680,8640]

Switch Scene

Op3
ScrOne byte, value 1 to 4, specifying the screen group number
DATAScene name (UTF8 format)
ExamplesSwitch screen group 1 to "Scene5": $31Scene5^ Switch screen group 2 to "ab": $32ab^ Switch screen group 3 to "123ab": $33123ab^ Switch screen group 4 to "Scene6a": $34Scene6a^ Scene name "1" code: 24 33 31 31 5E Scene name "2" code: 24 33 31 32 5E Scene name "3" code: 24 33 31 33 5E
Device ResponseOp: 3 DATA: Ok or Error

Open Window with Signal Source

Op4
ScrOne byte, value 1 to 4, specifying the screen group number
DATA[WindowID][Input Slot 1-16][Input Port 1-8][Top-left X,Top-left Y,Bottom-right X,Bottom-right Y] Window ID must be an integer >=1, with uniqueness; multiple windows cannot have duplicate IDs.
ExamplesOpen input slot 2 port 3 on group 1, window ID=2, coords 1920,1080,3840,2160: $41[2][2][3][1920,1080,3840,2160]^ Hex code: 24 34 31 5B 32 5D 5B 32 5D 5B 33 5D 5B 31 39 32 30 2C 31 30 38 30 2C 33 38 34 30 2C 32 31 36 30 5D 5E
Device ResponseOp: 4 DATA: Ok or Error

Switch Window Signal Source

Op5
ScrOne byte, value 1 to 4, specifying the screen group number
DATA[WindowID][Input Slot 1-16][Input Port 1-8] Window ID can be obtained via Get Current Window List interface.
ExamplesSwitch input slot 2 port 3 to window ID 21326 on group 1: $51[21326][2][3]^ Hex code: 24 35 31 5B 32 31 33 32 36 5D 5B 32 5D 5B 33 5D 5E
Device ResponseOp: 5 DATA: Ok or Error

Get Processor IP

Op6
ScrNone
DATANone
Example$6^
Device ResponseOp: 6 DATA: Processor IP. Example: IP:[192.168.1.250]

Set Processor IP Address

Op7
ScrNone
DATAIP address
ExampleSet processor IP address to 192.168.1.200: $7192.168.1.200^
Device ResponseOp: 7 DATA: Ok or Error

Reset Processor

Op8
ScrNone
DATANone
Example$8^
Device ResponseOp: 8 DATA: Ok or Error, device restarts after successful reset

Switch Audio Channel

Op9
ScrNone
DATA[Input Slot 1-16][Input Port 1-8] To close audio input, set both input slot and input port to 0.
ExamplesSwitch to slot 2 port 3: $9[2][3]^ Close audio input: $9[0][0]^ Switch to slot 2 port 3 hex code: 24 39 5B 32 5D 5B 33 5D 5E Close audio hex code: 24 39 5B 30 5D 5B 30 5D 5E
Device ResponseOp: 9 DATA: Ok or Error

Close Window

Op0
ScrOne byte, value 1 to 4, specifying the screen group number
DATA[WindowID] To close all windows in current group, set WindowID to 0.
ExamplesClose group 2 window ID 1: $02[1]^ Close group 1 all windows: $01[0]^ Close group 2 window ID 1 hex: 24 30 32 5B 31 5D 5E Close group 1 all windows hex: 24 30 31 5B 30 5D 5E
Device ResponseOp: 0 DATA: Ok or Error

Move Window

Opa
ScrOne byte, value 1 to 4, specifying the screen group number
DATA[WindowID][Top-left X,Top-left Y,Bottom-right X,Bottom-right Y] Window ID can be obtained via Get Current Window List interface. 0509 point-to-point mode does not support window operations.
ExampleMove group 1 window ID 1 to 1920,1080,3840,2160: $a1[1][1920,1080,3840,2160]^ Hex code: 24 61 31 5B 31 5D 5B 31 39 32 30 2C 31 30 38 30 2C 33 38 34 30 2C 32 31 36 30 5D 5E
Device ResponseOp: a DATA: Ok or Error