Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
31 views37 pages

ColorlightCSerial InterfaceBetweenDeviceAndServer

The document outlines the interface between Colorlight devices and a cloud server, detailing commands, GPS reporting, and command scheduling. It provides specific API endpoints, request/response formats, and examples for device-server interactions. The document serves as a technical guide for developers to implement and manage device commands and GPS data reporting effectively.

Uploaded by

vijay.khuspe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views37 pages

ColorlightCSerial InterfaceBetweenDeviceAndServer

The document outlines the interface between Colorlight devices and a cloud server, detailing commands, GPS reporting, and command scheduling. It provides specific API endpoints, request/response formats, and examples for device-server interactions. The document serves as a technical guide for developers to implement and manage device commands and GPS data reporting effectively.

Uploaded by

vijay.khuspe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Colorlight Co., Ltd.

Interface Between Device & Cloud Server

v0.9
Contents
Command.................................................................................................................................................................................. 3
ENDPOINT..........................................................................................................................................................................3
REQUEST............................................................................................................................................................................3
Server Response................................................................................................................................................................ 4
Commands Available.........................................................................................................................................................4
Device reports command received....................................................................................................................................5
Example: Quick testing on Server side...............................................................................................................................5
GPS Report.................................................................................................................................................................................6
Device Reports GPS Position to the Server........................................................................................................................6
Enabling GPS report in the Device.....................................................................................................................................7
To verify that the device is correctly set up with an API............................................................................................7
Command Schedule...................................................................................................................................................................7
Step 1. Get Commands......................................................................................................................................................8
Device Request.........................................................................................................................................................8
Server Response.......................................................................................................................................................8
Step 2. Tell Server Command Received..............................................................................................................................8
Device Request.........................................................................................................................................................8
Server Response.......................................................................................................................................................9
Step 3. Get Schedule Content............................................................................................................................................9
Device Request.......................................................................................................................................................... 9
Server Response........................................................................................................................................................ 9
Content Schedule.................................................................................................................................................................... 13
Sequence......................................................................................................................................................................... 14
Step 1. Get Commands....................................................................................................................................................15
Device Request........................................................................................................................................................ 15
Server Response...................................................................................................................................................... 15
Step 2. Tell Server Command Received............................................................................................................................16
Device Request........................................................................................................................................................ 16
Server Response...................................................................................................................................................... 16
Step 3. Get Schedule Content..........................................................................................................................................16
Device Request........................................................................................................................................................ 16
Server Response...................................................................................................................................................... 16
Step 4. Get all programs info...........................................................................................................................................18
ENDPOINT................................................................................................................................................................18
REQUEST..................................................................................................................................................................18
Server Response...................................................................................................................................................... 18
Setp 5. Get program’s vsn file and the resource files URL...............................................................................................19
ENDPOINT................................................................................................................................................................19
REQUEST..................................................................................................................................................................19
Server Response...................................................................................................................................................... 19
VSN Format..............................................................................................................................................................................20
VSN File Structure............................................................................................................................................................20
XML Structure..................................................................................................................................................................21
Properties........................................................................................................................................................................ 22
Program properties..................................................................................................................................................22
Page properties........................................................................................................................................................22
Region properties.................................................................................................................................................... 22
Item properties........................................................................................................................................................23
Examples..........................................................................................................................................................................26
Image.......................................................................................................................................................................26
Video........................................................................................................................................................................27
Single line Text.........................................................................................................................................................28
Multi line Text..........................................................................................................................................................29
Command

1. The device requests every 5 seconds towards the server for Commands.
2. If the server has any pending Commands to be issued to the device, according to the device’s request parameter
such as the device_num (Serial Number), or the device account (in the HTTP HEADER BASIC AUTHENTICATION),
responses with corresponding commands.
3. The device will response (POST) the server on receiving command(s), in order to inform the server that the
command(s) was fetched. While on the server side, the server could delete the Command from the pending
command list, and updates its internal device online status if necessary.
4. The server MUST response HTTP 2xx, otherwise the device will not carry out the command(s) that it received in
step 2.
5. ONLY on receiving the HTTP 2xx response from the server, the device is going to act according to the Command(s)
from the server.

ENDPOINT

GET /wp-json/wp/v2/comments?clt_type=terminal&device_num=CLCC40000AAA

REQUEST

Method
GET
Parameter
1. clt_type: terminal, fixed.
2. device_num: serial number of the device.
HEADERS
Authorization: Basic AABBCCDDEE

Basically, the device account in the server. The server can authenticate the device according to the account based on this
HEADER.

Server Response

Status code:
HTTP/1.1 200 OK
BODY
 If the server would like to send command(s), use JSON array containing Commands.

Command Example:

{
"id": 8,
"post": 7,
"author_url": "api\/action",
"content": {
"raw": "{\"command\":\"wakeup\"}"
},
"karma": 1
}

 If the server doesn’t for the moment any pending commands, just response an empty Array:
[]

Keys
1. id: the Command ID, normally incremental.
2. post: the LED ID, used later for reporting the command result.
3. content object:
a. raw:
i. command: the command in string.
ii. program: schedule
4. karma:
a. 0 - GET in the device
b. 1 - POST in the device
c. 2 - PUT in the device
d. 3 - Delete in the device
Commands Available

LED act_url Karma content Comments


Command (act_method)
Sleep api/action 1 "raw":
{\"command\":\"sleep
\"}
Wakeup api/action 1 "raw":
{\"command\":\"wakeu
p\"}
Reboot api/action 1 "raw":
{\"command\":\"reboot
\"}
Switch /api/vsns/sources/lan/vsns/new.vsn/ 2
program activated
Delete /api/vsns/sources/lan/vsns/q.vsn 3
program
Configure /api/locale 2 "raw":
locale {\"language \": \"zh\",\"co
untry\": \"CN\"}
Configure
Sending Card
Configure /api/volume 2 "raw": {
Volume \"musicvolume\":10
Level }
Configure /api/brightness 2 "raw": 0-255
Brightness {\"brightness\":60}
Schedule 0 "raw":"{\"program\":\"sc Schedule
hedule\"}"}

Device reports command received

POST /wp-json/wp/v2/comments?post=7

HEADER:
Authorization: Basic dDE1MTU0ejBQMWRTNTU1OjE1QjE1NDAxNTU1
Content-Type: application/json

BODY:
{"parent":8,"content":"Executable comment"}

1. parent: the command id that the report is responding to, this is an ID from the GET Commands step.
2. content: constant string Executable comment.

Example: Quick testing on Server side

1. Create a folder /wp-json/wp/v2/ in your server.


2. Create a file named comments under your /wp-json/wp/v2/.
3. Edit the comments file, Copy & Paste the content below

[{
"id": 8,
"post": 7,
"author_url": "api\/action",
"content": {
"raw": "{\"command\":\"wakeup\"}"
},
"karma": 1
}]

To the comments file.


4. The device under test, configured with the server will fetch the comments in every 5 seconds (commands).
a. To configure the device regarding the device account and the server URL, please use the API below when
connecting your PC with the device via the USB Cable: (Please use Chrome extension Postman for the
testing)
i. PUT http://192.168.42.129/api/account
ii. HEADER: Content-type: application/json; charset=utf-8
iii. JSON BODY:

{
"name": "terminal_account_name",
"password": "password_configured_in_server ",
"url": "https://your_cloudserver.com"
}
iv. Check out the account configuration:
1. GET http://192.168.42.129/api/account.json

NOTE:
 The IP 192.168.42.129 is the static IP of the device when it’s connecting to the PC via USB Cable.
 The device acts as a DHCP Server, and assigns to the PC an IP in range of 192.168.42.*, once the
USB Cable is connected to the device’s CONFIG port.

5. The device will report the result to the server before it carrying out the command specified in the “raw” object.
6. ONLY after the server responded with 200 OK, the device will carry out the command.
Status Report

The C Serial device reports a full state list on Device Boot or Server change.
In order to fetch specific report from the device, the server has to ask for the data via Command interface.

Info

1. GetComments

The device is constantly querying the server for “Comments”, with its ID and Authentication Header.
2. Comments

The server response the device with:


{
"id": 6,
"post": 7,
"author_url": "api/info",
"content": {
"raw": "{}"
},
"karma": 0
}
]

NOTE: there is no ".json" suffix in the api/info URL, which differs from the Local API spec.

3. UpdateInfo

Upon receive the request, the device response to the endpoint of:

/wp-json/screen/v1/status
With PUT method, the following application/json content:

{
"info": {
"info": {
"vername": "1.52.9",
"serialno": "CLCC40000321",
"model": "c4",
"up": 72943016,
"mem": {
"total": 1073741824,
"free": 747450368
},
"storage": {
"total": 5878841344,
"free": 5866962944
},
"playing": {
"name": "new.vsn",
"path": "/mnt",
"source": "lan"
}
}
}
}

NOTE: For other api GET result, please check the LOCAL RESTFul API spec. Don’t forget to remove “.json” from the LOCAL
RESTFul API endpoint, when asking the device for the states. For instance: api/powerstatus, api/dimension, api/ifstatus,
api/vsns, api/volume, etc.

Screenshot

1. Get Comments

The device is constantly querying the server for “Comments”, with its ID and Authentication Header.
2. Comments

The server response the device with:


[
{
"id": 7,
"post": 7,
"author_url": "screenshot",
"content": {
"raw": "{}"
},
"karma": 0
}
]

NOTE: Need only “screenshot” as the URL for the screenshot.

3. Upload Screenshot

Upon receive the request, the device response to the endpoint of:

POST /wp-json/wp/v2/media

Authorization: Basic YWFhOjExMTExMQ==


Content-Disposition: attachment;filename=led.jpeg
Content-Type: image/jpeg

......JFIF.............C...............
.

...............%...#... , #&')*)..-0-(0%()(...C....

GPS Report

Whatever Colorlight C Serial device installed with the 4G module ( For instance C4 w/ 4G module), also has the GPS
hardware feature.
The device must be configured, before it can report in interval it’s GPS data to the server.
Device Reports GPS Position to the Server

POST /wp-json/led/v2/monitor

HEADER:
Authorization: Basic dDE1MTXXX
Content-Type: application/json

BODY:
[
{
"date":"2017-12-15 10:48:57",
"sensorId":"1",
"sensorType":"gps",
"longitude":119.213123,
"latitude":121.123123
}
]

1. date: the device local date time, when the GPS position is retrieved from the hardware.
2. sensorId: which GPS sensor this data comes from, normally 1.
3. sensorType: “gps” - for GPS, the sensorType is always “gps”.
4. Longitude, latitude

Enabling GPS report in the Device

Connect the PC with, for instance, a C4 with the USB Cable. In this case, the C4 will have a fixed IP: 192.168.42.129.
The following is a LOCAL api from PC to device to set up the GPS report interval. Normally, this happens on device setup
procedure.

POST http://192.168.42.129/setreporttime

HEADER:
Content-Type: application/json

BODY:
{
"gps.report.interval": 60
}

1. gps.report.interval: the interval (in seconds), that the device will report its GPS position to the server.
a. The example above sets up the device to report in every 60 seconds interval (1 min) its current position to
the server.
To verify that the device is correctly set up with an API

GET http://192.168.42.129/reporttime.json

BODY:

{
"gps_report_interval": 60,
"sensor_report_interval": 0,
"ber_report_interval": 0
}

The “gps_report_interval”: 60 here is an example of the current GPS report interval, which means that the device report in
every 60 seconds its current position.

Command Schedule

There are basically 3 steps involved for a device to fetch command schedule from the Server:
1. The device requests commands from the server. If there are any schedules waiting for the device, the server MUST
response with a schedule command.
2. On receiving a command from the server, the device responses to the server that it received the command.
3. The device requests schedule from the server and schedule commands accordingly.

Step 1. Get Commands

Device Request

GET /wp-json/wp/v2/comments?clt_type=terminal&device_num=CLCC4000000E HTTP/1.1


Authorization: Basic VXRlc3Q6MTIzNDU2

Server Response

HEADER: Content-type: application/json; charset=utf-8

BODY:
[
{
"id": 4058,
"post": 6088,
"author_url": "",
"content": {
"raw": "{\"program\":\"schedule\"}"
},
"karma": 0
}

The server is notifying the device, that for the moment there is a command pending in the server for it.

Keys
Id: command ID. Incremental. (Mandatory)
post: LED ID. (Mandatory), will be used below so that the device can response this command.

Step 2. Tell Server Command Received

Device Request

POST /wp-json/wp/v2/comments?post=6088 HTTP/1.1


Authorization: Basic VXRlc3Q6MTIzNDU2
Content-Type: application/json; charset=utf-8

Parameter

post: the LED ID from the command. (Mandatory)

Body
{"parent":4058,"content":"Executable comment"}

Keys

parent – the command id that the device acknowledging. Comes from the command in the “Get Commands” step.
(Mandatory)
content – Constant String. “Executable comment". (Mandatory)
Server Response

HTTP/1.1 201 Created

Step 3. Get Schedule Content

Device Request

GET /wp-json/wp/v3/schedules HTTP/1.1


Authorization: Basic VXRlc3Q6MTIzNDU2

Server Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
"contentsSchedule": [],
"commandSchedule":[
{
"name":"Reboot",
"type":"command",
"operation":{
"author_url":"api/action",
"karma":1,
"content":"{"command":"reboot"}"
},
"op_time":[
"14:05:42"
],
"if_limit_date":false,
"if_limit_weekday":false,
"limit_date":{
"start":"2017-12-07",
"end":"2017-12-07"
},
"limit_weekday":[
true,
true,
true,
true,
true,
true,
true
]
},
{
"name":"Sleep",
"type":"command",
"operation":{
"author_url":"api/action",
"karma":1,
"content":"{"command":"sleep"}"
},
"op_time":[
"14:07:00"
],
"if_limit_date":false,
"if_limit_weekday":false,
"limit_date":{
"start":"2017-12-07",
"end":"2017-12-07"
},
"limit_weekday":[
true,
true,
true,
true,
true,
true,
true
]
},
{
"name":"Wakeup",
"type":"command",
"operation":{
"author_url":"api/action",
"karma":1,
"content":"{"command":"wakeup"}"
},
"op_time":[
"14:09:28"
],
"if_limit_date":false,
"if_limit_weekday":false,
"limit_date":{
"start":"2017-12-07",
"end":"2017-12-07"
},
"limit_weekday":[
true,
true,
true,
true,
true,
true,
true
]
},
{
"name":"Brightness_Control",
"type":"command",
"operation":{
"author_url":"api/brightness",
"karma":2,
"content":"{"brightness":147}"
},
"op_time":[
"14:11:35"
],
"if_limit_date":false,
"if_limit_weekday":false,
"limit_date":{
"start":"2017-12-07",
"end":"2017-12-07"
},
"limit_weekday":[
true,
true,
true,
true,
true,
true,
true
],
"content":{
"name":"Value",
"value":147
}
},
{
"name":"Colortemp_Control",
"type":"command",
"operation":{
"author_url":"api/colortemp",
"karma":2,
"content":"{"colortemp":7100}"
},
"op_time":[
"14:13:50"
],
"if_limit_date":false,
"if_limit_weekday":false,
"limit_date":{
"start":"2017-12-07",
"end":"2017-12-07"
},
"limit_weekday":[
true,
true,
true,
true,
true,
true,
true
],
"content":{
"name":"Value",
"value":7100
}
},
{
"name":"Volume_Control",
"type":"command",
"operation":{
"author_url":"api/volume",
"karma":2,
"content":"{"musicvolume":8}"
},
"op_time":[
"14:16:00"
],
"if_limit_date":false,
"if_limit_weekday":false,
"limit_date":{
"start":"2017-12-07",
"end":"2017-12-07"
},
"limit_weekday":[
true,
true,
true,
true,
true,
true,
true
],
"content":{
"name":"Value",
"value":8
}
}
]

Content Schedule

There are basically 6 steps involved for a device to fetch content schedule from the Server:
1. The device requests commands from the server. If there are any schedules waiting for the device, the server MUST
response with a schedule command.
2. On receiving a command from the server, the device responses to the server that it received the command.
3. The device requests schedule from the server.

Download programs if necessary.


4. The device requests all programs published to it as referenced in content schedule.
5. After parsing programs JSON data, the device iterates each program, by requesting its resources (incl. VSN – an
XML file specifying program layout).
6. The device checks its local storage of the availability of the assets and programs, and downloads any missing
assets and programs. Once a program is downloaded, the content is made ready for scheduling.
Sequence
Step 1. Get Commands

Device Request

GET /wp-json/wp/v2/comments?clt_type=terminal&device_num=CLCC4000000E HTTP/1.1


Authorization: Basic VXRlc3Q6MTIzNDU2

Server Response

HEADER: Content-type: application/json; charset=utf-8

BODY:

[
{
"id": 4058,
"post": 6088,
"author_url": "",
"content": {
"raw": "{\"program\":\"schedule\"}"
},
"karma": 0
}

The server is notifying the device, that for the moment there is a command for the device.

Keys
id: command ID. Incremental. (Mandatory)
post: LED ID. (Mandatory), will be used below so that the device can response this command.
content
raw
program : “schedule”. Constant string for schedule command. (Mandatory)
author_url
“”. leave empty.
karma
0 – for schedule. (Mandatory)
Step 2. Tell Server Command Received

Device Request

POST /wp-json/wp/v2/comments?post=6088 HTTP/1.1


Authorization: Basic VXRlc3Q6MTIzNDU2
Content-Type: application/json; charset=utf-8

Parameter

post: the LED ID from the command. (Mandatory)

BODY
{"parent":4058,"content":"Executable comment"}

Keys

parent – the command id that the device acknowledging. Comes from the command in the “Get Commands” step.
(Mandatory)
content – Constant String. “Executable comment". (Mandatory)

Server Response

HTTP/1.1 201 Created

Step 3. Get Schedule Content

Device Request

GET /wp-json/wp/v3/schedules HTTP/1.1


Authorization: Basic VXRlc3Q6MTIzNDU2

Server Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
{
"contentsSchedule": [
{
"name": "Play_Program",
"type": "rotation",
"type_priority": 200,
"priority": "0",
"operation": {
"id": 6085,
"name": "program_demo",
"vsn": "program_demo_699AB39DF0471DCEC795CD3C8DFC47D3_1733.vsn",
"source": "internet"
},
"if_limit_time": false,
"if_limit_date": false,
"if_limit_weekday": false,
"limit_time": {
"start_time": "06:00:00",
"end_time": "18:00:00"
},
"limit_date": {
"start": "2018-01-27",
"end": "2018-01-27",
"start_time": "00:00:00",
"end_time": "23:59:59"
},
"limit_weekday": [
true,
true,
true,
true,
true,
true,
true
]
}
],
"commandSchedule": []
}

Keys
contentsSchedule

Array contains content schedules for the device.

type – the type of the schedule mode that the program is on, there are three modes available:
1. spot
When there is a spot content coexisting with others at the same time, only the spot content will play.
Moreover, when multiple spot contents coexist, the one in the front rank (defined in the “priority” key
below”) will play.
2. rotation
All the rotation contents on the list will play in turn, the order is defined in the “priority” key below”,
on the premise that there is no spot content at the same time.
3. spare
The spare content in the front rank/on the top of the priority list rank (defined in the “priority” key
below”) will cover the rest, on the premise that neither spot nor rotation contents exist at the same
time.
type_priority
1. spot - 100, constant integer.
2. rotation - 200, constant integer.
3. spare – 300, constant integer.
Priority : integer. Priority of a program within a type, used to define the priority of a program within the same
type_priority. When there are multiple programs scheduled in the same type (spot|rotation|spare) at the same time,
the priority key here indicates the priority of the program.
Smaller integer value has a higher priority. 0 - the highest priority.
operation
id: program ID (Mandatory, must be in the programs list in the step below)
vsn: program name, in format of ProgramName_{MD5}_{FileSize}.vsn (Mandatory, the vsn file name)
source: internet. Constant String “internet”. (Mandatory, === “internet”)
name: Optional.

If the VSN and the resource files that the VSN is referencing already exist, the device will schedule the program instantly,
otherwise the device will have to download the program and its resource files in following steps.

Step 4. Get all programs info

ENDPOINT

GET /wp-json/wp/v2/programs?clt_type=terminal

REQUEST

Method: GET
Parameters
1. clt_type: terminal. Constant String “terminal”.
HEADERS
Authorization: Basic AABBCCDDEE

Server Response

Status code:
HTTP/1.1 200 OK
BODY
[
{
"id":6085,
"modified_gmt":"2018-01-27T07:38:59",
"title":{
"rendered":"program_demo"
},
"_links":{
"wp:attachment":[
{
"href":"http://192.168.1.172/wp-json/wp/v2/media?parent=6085"
}
]
}
}
]
Keys
1. id, the id of program. (Mandatory, the id of the program in the server.)
2. modified_gmt, the program last modified time(gmt). (Mandatory, MUST be in format yyyy-mm-ddThh:mm:ss)
3. title --> rendered, the name of program. (Optional)
4. _links --> wp:attachment --> href, a link for retrieving the program’s vsn file and the resource files URL.
(Mandatory, the device is going to list/download all the files referenced by the program incl. the VSN file itself
following this link)

Setp 5. Get program’s vsn file and the resource files URL

ENDPOINT

GET /wp-json/wp/v2/media?parent=6085

REQUEST

Method: GET
Parameter
1. parent: program id.
HEADERS
Authorization: Basic AABBCCDDEE
Server Response

Status code:
HTTP/1.1 200 OK
BODY
[
{
"id": 6087,
"attachment_filesize": 1733,
"source_url": "http://192.168.1.172/files/ program_demo_699AB39DF0471DCEC795CD3C8DFC47D3_1733.vsn"
},
{
"id": 6086,
"attachment_filesize": 9670,
"source_url": "http://192.168.1.172/files/F_EDA7B7C6B5B3A35349FD707091E43A7A_9670.jpg"
}
]
Keys
1. id, the id of the resource. ). (Mandatory)
2. attachment_filesize, the size of the resource (unit: Bytes). (Mandatory)
3. source_url, the URL of the resource. (Mandatory)
a) The last path segment of the source_url MUST be file name reference in the VSN file (program layout
specification file). Check the VSN format below for the file structure.
b) (The resource file name should be in the format of FileName_{md5}_{file size}.FileExtension).

After successfully downloading all the VSN files and the resources filed, the device is going to play the content according to
the schedule.

VSN Format

VSN File Structure

The VSN file is a XML file, its internal structure is illustrated below: (Better to check firstly a VSN example before checking
the detailed structure spec below)
XML Structure

<?xml version="1.0" encoding="utf-8" ?>


-<Programs> // Programs node
-<Program> // Program node
Program properties…
-<Pages> // Pages node
-<Page>// Page1 node
Page properties…
-<Regions> // Regions node
-<Region> // Region1 node
Region properties…
-<Items> // Items node
-<Item> // Item1 node
Item properties…
-</Item>
-<Item> // Item2 node
Item properties…
-</Item>
……
-<Item/> // ItemN node
-</Items>
-</Region>
-<Region/> // Region2 node
……
-<Region/> // RegionN node
</Regions>
-</Page>
-<Page/> // Page2 node
……
-<Page/> // PageN node
</Pages>
</Program>
</Programs>

Properties

Program properties

<Information> // Program info


<Width/> // Program width (int)
<Height/> // Program height (int)
</Information>

Page properties

<AppointDuration/> // Page duration (milliseconds)


<LoopType/> // 0 – Use the page duration, 1 – Play all the contents in the page and switch to the next
page, default 1
<BgColor/> // Page background color (default #000000)
Region properties

<Layer/> // 1 - the upper layer, 2 - the second layer, 3 – the third layer…
<Rect> // Region position
<X/> // X (int)
<Y/> // Y (int)
<Width/> // Region Width (int)
<Height/> // Region Height (int)
<BorderWidth/> // Border width (0, 1, 2, 3, 4. default 0)
<BorderColor/> // Border color (default #000000)
</Rect>

Item properties

Picture

<Type/> // must be 2
<Alpha/> // Alpha (0.0 ~ 1.0, default 1.0)
<Duration/> // duration in millisecond, including the inEffect ->Time.
<inEffect> // transition
<Type/> // transition type, valid values are:
// 0 – NO Effect
// 1 – Random effect (default)
// 2 - Left unveil
// 3 - Right unveil
// 4 - Upper unveil
// 5 - Bottom unveil
// 6 - Upper Left Corner of Coverage(slash)
// 7 - Upper Right Corner of Coverage(slash)
// 8 - Bottom Left Corner of Coverage(slash)
// 9 - Bottom Right Corner of Coverage(slash)
// 10 - Upper Left Corner of Coverage(straightline)
// 11 - Upper Right Corner of Coverage(straightline)
// 12 - Bottom Left Corner of Coverage(straightline)
// 13 - Bottom Right Corner of Coverage(straightline)
// 14 - Horizontal Shutter
// 15 - Vertical Shutter
// 16 - Divide Left to Right
// 17 - Divide Top to Bottom
// 18 - Closed Left to Right
// 19 - Closed Top to Bottom
// 20 - Scroll Up
// 21 - Scroll Down
// 22 - Scroll Left
// 23 - Scroll Right
// 24 - Scroll Left Up Corner
// 25 - Scroll Right Up Corner
// 26 - Scroll Left Down Corner
// 27 - Scroll Right Down Corner
// 28 - Mosaic(small)
// 29 - Mosaic(medium)
// 30 - Mosaic(big)
// 31 - Gradual Change
// 32 - Rotation Right 360
// 33 - Rotation Left 360
// 34 - Rotation Right180
// 35 - Rotation Left180
// 36 - Rotation Right 90
// 37 - Rotation Left 90
// 38 - From Small to Big(middle)
// 39 - From Small to Big Upper(left)
// 40 - From Small to Big Upper(right)
// 41 - From Small to Big Under(right)
// 42 - From Small to Big Under(left)
// 43 - Center to Around(rectangle)
// 44 - Around to Center(rectangle)
// 45 - Center to Around(diamond)
// 46 - Around to Center(diamond)
// 47 - Center to Around(cross)
// 48 - Around to Center(cross)
<Time/> // transition duration (millisecond)
</inEffect>
<FileSource>
<IsRelative/> // must be 1
<FilePath/> // the picture file path.
eg.
“.\_Res_.files\F_6181AEDB53AB19C4E4EEC2266257EBBF_14130.jpg”
PS: “.\_Res_.files\” is fixed, picture file name specification: FileName_md5_[file size]. The file name of
the picture resource downloaded. The file name is the last path segment of the URL.
</FileSource>
<ReserveAS/> //1 - Keep image aspect ratio, otherwise 0.
Video

<Type/> // must be 3
<Duration/> // duration (millisecond)
<Volume/> // volume (0.0~1.0, default 1.0)
<FileSource>
<IsRelative/> // must be 1
<FilePath/> // the video file path.
eg.
“.\_Res_.files\F_7EB8593C635D7942E2BE3268989D744C_4673805.mp4”
PS: “.\_Res_.files\” is fixed, video file name specification: F_md5_[file size]
</FileSource>
<ReserveAS/> //1 - Keep video aspect ratio, otherwise 0.

Single Line Text

<Type/> // must be 4
<BackColor/> // background color (default #00000000)<TextColor/> // text color (default #FFFFFF)
<LogFont> // font properties
<lfHeight/> // font size (unit: pixel)
<lfWeight/> // font weight (0~1000, default 400)
<lfItalic/> // 1 – italic, 0 - normal
<lfUnderLine/> // 1 – underline, 0 - normal
<lfFaceName/> // Typeface (default Arial)
</LogFont>
<Text/> // single line content

<IsScroll/>
// 1 – Move Left, 0 – Paged (Automatically paged if there are more text than that can be displayed in
one screen.)

// Paged (i.e., “IsScroll” is 0). Automatically pages on text exceeding the region area.
<MultiPicInfo> // Depends on Paged (i.e. “IsScroll” is 0)
<OnePicDuration/> // each page duration if paged (millisecond)
</MultiPicInfo>
<PlayTimes/> // Depends on Paged (i.e., “IsScroll” is 0), Play for how many times the paged contents.
(Default 1)

// Scroll (i.e., “IsScroll” is 1).


<Speed/> // Depends on scroll (i.e., “IsScroll” is 1). Scroll pixels per second.
<IsHeadConnectTail/> // Depends on scroll (i.e., “IsScroll” is 1). Scroll render style.
1 - head connect tail, otherwise 0.
<IsScrollByTime> // Depends on scroll. (i.e., “IsScroll” is 1). Scroll duration favour.
1 – Scroll and Scroll by time, PlayLength can not be empty and RepeatCount is invalid,
0 – Scroll, RepeatCount is valid.
<RepeatCount/> // Depends on scroll and NOT IsScrollByTime. (i.e., “IsScroll” is 1 and “IsScrollByTime”
is 0). The duration is determined by scroll repeats.
<PlayLength/> // Depends on scroll and IsScrollByTime. (i.e., “IsScroll” is 1 and “IsScrollByTime” is 1).
The duration is determined by time here (millisecond)

Multi Line Text

<Type/> // must be 5
<BackColor/> // background color (default #00000000)

<TextColor/> // text color (default #FFFFFF)


<LogFont> // font properties
<lfHeight/> // font size (unit: pixel)
<lfWeight/> // font weight (0~1000, default 400)
<lfItalic/> // 1 – italic, 0 - normal
<lfUnderLine/> // 1 – underline, 0 - normal
<lfFaceName/> // Typeface (default Arial)
</LogFont>
<Text/> // single line content

<IsScroll/> // 1 – Move Up, 0 – Paged (Automatically paged if there are more text than that can be
displayed in one screen.)

// Paged (i.e., “IsScroll” is 0). Automatically pages on text exceeding the region area.
<MultiPicInfo> // Paged (i.e. “IsScroll” is 0)
<OnePicDuration/> // each page duration (millisecond)
</MultiPicInfo>
<PlayTimes/> // Paged (i.e., “IsScroll” is 0), Play this item how many times on Paged. (default 1)

// Scroll (i.e., “IsScroll” is 1).


<Speed/> // Depends on scroll (i.e., “IsScroll” is 1). Scroll pixels per second.
<IsHeadConnectTail/> // Depends on scroll (i.e., “IsScroll” is 1). Scroll render style.
1 - head connect tail, otherwise 0.
<IsScrollByTime> // Depends on scroll. (i.e., “IsScroll” is 1). Scroll duration favour.
1 – Scroll and Scroll by time, PlayLength can not be empty and RepeatCount is invalid,
0 – Scroll, RepeatCount is valid.
<RepeatCount/> // Depends on scroll and NOT IsScrollByTime. (i.e., “IsScroll” is 1 and “IsScrollByTime”
is 0). The duration is determined by scroll repeats.
<PlayLength/> // Depends on scroll and IsScrollByTime. (i.e., “IsScroll” is 1 and “IsScrollByTime” is 1).
The duration is determined by time here (millisecond)
Examples

Image

<?xml version='1.0' encoding='utf-8'?>


<Programs>
<Program>
<Information>
<Width>256</Width>
<Height>256</Height>
</Information>
<Pages>
<Page>
<AppointDuration>3600000</AppointDuration>
<LoopType>1</LoopType>
<BgColor>#000000</BgColor>
<Regions>
<Region>
<Layer>1</Layer>
<Rect>
<X>4</X>
<Y>12</Y>
<Width>242</Width>
<Height>136</Height>
<BorderWidth>1</BorderWidth>
<BorderColor>#ff0000</BorderColor>
</Rect>
<Items>
<Item>
<Type>2</Type>
<Alpha>1.000000</Alpha>
<Duration>56000</Duration>
<inEffect>
<Type>1</Type>
<Time>500</Time>
</inEffect>
<FileSource>
<IsRelative>1</IsRelative>
<FilePath>.\_Res_.files\F_6181AEDB53AB19C4E4EEC2266257EBBF_14130.jpg</FilePath>
</FileSource>
<ReserveAS>1</ReserveAS>
</Item>
</Items>
</Region>
</Regions>
</Page>
</Pages>
</Program>
</Programs>

Video

<?xml version='1.0' encoding='utf-8'?>


<Programs>
<Program>
<Information>
<Width>256</Width>
<Height>256</Height>
</Information>
<Pages>
<Page>
<AppointDuration>3600000</AppointDuration>
<LoopType>1</LoopType>
<BgColor>#000000</BgColor>
<Regions>
<Region>
<Layer>1</Layer>
<Rect>
<X>2</X>
<Y>2</Y>
<Width>250</Width>
<Height>141</Height>
<BorderWidth>0</BorderWidth>
<BorderColor>#f79646</BorderColor>
</Rect>
<Items>
<Item>
<Type>3</Type>
<Duration>5000</Duration>
<Volume>1.000000</Volume>
<FileSource>
<IsRelative>1</IsRelative>
<FilePath>.\_Res_.files\
F_7EB8593C635D7942E2BE3268989D744C_4673805.mp4</FilePath>
</FileSource>
<ReserveAS>1</ReserveAS>
</Item>
</Items>
</Region>
</Regions>
</Page>
</Pages>
</Program>
</Programs>

Single line Text

<?xml version='1.0' encoding='utf-8'?>


<Programs>
<Program>
<Information>
<Width>256</Width>
<Height>256</Height>
</Information>
<Pages>
<Page>
<AppointDuration>3600000</AppointDuration>
<LoopType>1</LoopType>
<BgColor>#000000</BgColor>
<Regions>
<Region>
<Layer>1</Layer>
<Rect>
<X>0</X>
<Y>44</Y>
<Width>240</Width>
<Height>64</Height>
<BorderWidth>4</BorderWidth>
<BorderColor>#ffff00</BorderColor>
</Rect>
<Items>
<Item>
<Type>4</Type>
<BackColor>#f2f2f2</BackColor>
<TextColor>#ff0000</TextColor>
<LogFont>
<lfHeight>48</lfHeight>
<lfWeight>400</lfWeight>
<lfItalic>0</lfItalic>
<lfUnderLine>0</lfUnderLine>
<lfFaceName>Arial</lfFaceName>
</LogFont>
<Text>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</Text>
<IsScroll>0</IsScroll>
<MultiPicInfo>
<OnePicDuration>6000</OnePicDuration>
</MultiPicInfo>
<PlayTimes>1</PlayTimes>
</Item>
</Items>
</Region>
</Regions>
</Page>
</Pages>
</Program>
</Programs>

Multi line Text

<?xml version='1.0' encoding='utf-8'?>


<Programs>
<Program>
<Information>
<Width>256</Width>
<Height>256</Height>
</Information>
<Pages>
<Page>
<AppointDuration>3600000</AppointDuration>
<LoopType>1</LoopType>
<BgColor>#000000</BgColor>
<Regions>
<Region>
<Layer>1</Layer>
<Rect>
<X>19</X>
<Y>38</Y>
<Width>219</Width>
<Height>194</Height>
<BorderWidth>1</BorderWidth>
<BorderColor>#ffff00</BorderColor>
</Rect>
<Items>
<Item>
<Type>5</Type>
<BackColor>#00000000</BackColor>
<TextColor>#ffffff</TextColor>
<LogFont>
<lfHeight>28</lfHeight>
<lfWeight>400</lfWeight>
<lfItalic>0</lfItalic>
<lfUnderLine>0</lfUnderLine>
<lfFaceName>Arial</lfFaceName>
</LogFont>
<Text>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris fringilla
mi sed nulla aliquam interdum. Vestibulum sed nunc mi. Morbi tempor leo sit amet mauris
maximus, sit amet vulputate lacus luctus.</Text>
<IsScroll>1</IsScroll>
<Speed>120</Speed>
<IsHeadConnectTail>0</IsHeadConnectTail>
<RepeatCount>1</RepeatCount>
<PlayLength>15000</PlayLength>
</Item>
</Items>
</Region>
</Regions>
</Page>
</Pages>
</Program>
</Programs>

You might also like