跳转到内容

照明灯接口

用户可通过该请求分别设置头灯和尾灯的灯光模式、颜色以及占空比。

Type字段值Command字段值消息类型
1048581(0x0010 0005)2097154(0x0020 0002)机器人灯语

JSON格式请求:

{
"PatrolDevice": {
"Type": 1048581,
"Command": 2097154,
"Time": "2026-01-01 00:00:00.000",
"Items": {
"CustomMode": true,
"Led": [
{
"Type": 0,
"Color": [1],
"Cycle": 1
},
{
"Type": 0,
"Color": [2],
"Cycle": 1
}
]
}
}
}

XML格式请求:

<?xml version="1.0" encoding="UTF-8"?>
<PatrolDevice>
<Type>1048581</Type>
<Command>2097154</Command>
<Time>2026-01-01 00:00:00.000</Time>
<Items>
<CustomMode>true</CustomMode>
<Led>
<Type>0</Type>
<Color>1</Color>
<Cycle>1</Cycle>
</Led>
<Led>
<Type>0</Type>
<Color>2</Color>
<Cycle>1</Cycle>
</Led>
</Items>
</PatrolDevice>

该请求消息中,Items字段包含以下参数项:

参数项子参数含义数据类型单位参数值说明
CustomMode自定义灯语模式bool/开启自定义模式 = true;关闭自定义模式 = false
Led([0]:头灯;[1]:尾灯)Type灯光模式int/常亮 = 0;填充式流水灯 = 1;移动式流水灯 = 2;渐变式流水灯 = 3;呼吸灯 = 4;单色闪烁灯 = 5
Color灯光颜色array/黑色 = 0;白色 = 1;绿灯 = 2;蓝灯 = 3
Cycle占空比ints只有在呼吸和闪烁模式下才会使用占空比