跳至主要内容
版本: 3.4.x

活动频道

默认事件 websocket URL 为 ws://localhost:10020.注意:端口可在配置中更改。

这是一个低频单向通信通道,可接收所有系统事件。 不支持输入信息。

该通道保证为每个事件发送一条信息。

标准格式

所有活动都遵循如下所示的标准结构:

{
"name": "device-connected",
"category": "device",
"level": "notice",
"data": {},
"message": ""
}

字段说明

现场类型说明
namestring事件的唯一标识符。
categorystring用于筛选和组织的分组标签(见有效类别)。
levelstring事件的严重性或重要性(见有效级别)。
dataobject包含特定事件详细信息的有效载荷。
messagestring事件的可选人工可读描述或上下文。

活动类别

"(《世界人权宣言》) category 总部外办事处将活动分为以下几组

价值说明
system核心或中央系统、全局设置等。
input外部输入处理(如命令或其他)。
session与特定用户会话相关的事件。
device设备管理、控制器交互、串行端口通信。
module子系统或模块组件事件。
feature与特定服务特性或功能相关的事件。

活动级别

活动 level 字段表示事件的严重性或重要性:

价值说明
info仅供参考 - 日志、指标或非关键性通知。
notice国家变化或重大事件。
warning出错或似乎有问题,但系统可以安全继续运行。
error出现可能影响系统行为或稳定性的问题。
critical严重破坏系统功能的严重错误。
panic灾难性故障 - 可能导致崩溃或无法恢复的状态。

活动

信息

该列表是系统目前报告的事件列表。我们正在积极设计和扩展事件类型和报告。

输入

invalid-io-channel

当以不支持或非预期方式使用 I/O 通道时触发。

数据

现场类型说明
received_datastring收到的原始数据。
{
"name": "invalid-io-channel",
"category": "input",
"level": "warning",
"data": {
"received_data": "<raw_input_here>"
}
}

command-deprecated

当接收到的命令已过时并将在未来版本中删除时发出。

现场类型说明
commandstring收到的废弃命令

{
"name": "command-deprecated",
"category": "input",
"level": "warning",
"data": {
"command": "example_cmd"
},
"message": "The command `example_cmd` is deprecated and is replaced by `this_one`."
}

设备

device-connected

表示设备已连接并已完全运行。

现场类型说明
device_familystring设备类型: inverseverse_grip.
device_idstring设备的唯一标识符。
{
"name": "device-connected",
"category": "device",
"level": "notice",
"data": {
"device_family": "inverse",
"device_id": "04BA"
}
}

device-disconnected

表示先前连接的设备已断开连接。

现场类型说明
device_familystring设备类型: inverseverse_grip.
device_idstring设备的唯一标识符。
{
"name": "device-disconnected",
"category": "device",
"level": "notice",
"data": {
"device_family": "verse_grip",
"device_id": "61548"
}
}