事件通道
事件的标准 WebSocket URL 为 ws://localhost:10020.
该端口可在配置中进行修改。
这是一个低频、单向传输的通信通道,您可以通过它接收所有系统事件。 不支持输入消息。
该通道可确保针对每个事件仅发送一条消息。
统一格式
所有事件都遵循如下所示的标准结构:
{
"name": "device-connected",
"category": "device",
"level": "notice",
"data": {},
"message": ""
}
字段描述
| 费尔德 | Typ | 描述 |
|---|---|---|
name | string | 该事件的唯一标识符。 |
category | string | 用于筛选和整理的分组名称(参见有效分类)。 |
level | string | 事件的严重程度或重要性(参见有效等级)。 |
data | object | 包含事件具体细节的用户数据。 |
message | string | 关于该事件的可选、供人阅读的描述或背景信息。 |
事件类别
那片田野 category 将事件归入以下类别:
| Wert | 描述 |
|---|---|
system | 核心系统、全局设置等 |
input | 处理外部输入(例如命令等)。 |
session | 与特定用户会话相关的事件。 |
device | 设备管理、控制器交互、串口通信。 |
module | 子系统或模块化组件的事件。 |
feature | 与特定服务功能相关的事件。 |
事件级别
那片田野 level 表示事件的严重程度或重要性:
| Wert | 描述 |
|---|---|
info | 仅供参考——日志、指标或非关键性提示。 |
notice | 状态变化或值得注意的事件。 |
warning | 虽然出现了一些问题或存在不协调之处,但系统仍可安全地继续运行。 |
error | 出现了一个问题,该问题可能会影响系统的运行行为或稳定性。 |
critical | 严重错误,会严重影响系统功能。 |
panic | 灾难性故障——可能导致系统崩溃或陷入无法恢复的状态。 |
事件
信息
此列表包含系统当前报告的事件。我们目前正在积极开发和扩展事件类型及其报告功能。
输入
invalid-io-channel
当某个 I/O 通道以不支持或非预期的方式被使用时,将触发此事件。
数据
| 费尔德 | Typ | 描述 |
|---|---|---|
received_data | string | 收到的原始数据。 |
{
"name": "invalid-io-channel",
"category": "input",
"level": "warning",
"data": {
"received_data": "<raw_input_here>"
}
}
http-route-deprecated
当某个 HTTP 路由已过时且将在未来版本中移除时,会输出此信息。
数据
| 费尔德 | Typ | 描述 |
|---|---|---|
route | string | 过时的路线。 |
substitute | string | 推荐的替代方案。 |
{
"name": "http-route-deprecated",
"category": "input",
"level": "warning",
"data": {
"route": "/the/old/way",
"substitute": "/the/new/way"
}
}
settings-invalid-key
当设置键无效时,将返回此错误。
数据
| 费尔德 | Typ | 描述 |
|---|---|---|
key | string | 那把没找到的钥匙。 |
{
"name": "settings-invalid-key",
"category": "input",
"level": "warning",
"data": {
"key": "devices/none-existent/key"
}
}
command-deprecated
当某个传入的命令已过时且将在未来版本中移除时,会显示此信息。
| 费尔德 | Typ | 描述 |
|---|---|---|
command | string | 收到的过时命令 |
{
"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
表示设备已连接,现已完全准备就绪。
| 费尔德 | Typ | 描述 |
|---|---|---|
device_family | string | 设备类型: inverse oder简体中文(大陆) verse_grip. |
device_id | string | 该设备的唯一标识符。 |
{
"name": "device-connected",
"category": "device",
"level": "notice",
"data": {
"device_family": "inverse",
"device_id": "04BA"
}
}
device-disconnected
表示先前已连接的设备已断开连接。
| 费尔德 | Typ | 描述 |
|---|---|---|
device_family | string | 设备类型: inverse oder简体中文(大陆) verse_grip. |
device_id | string | 该设备的唯一标识符。 |
{
"name": "device-disconnected",
"category": "device",
"level": "notice",
"data": {
"device_family": "verse_grip",
"device_id": "61548"
}
}
会议
device-low-control-rate
当接收到针对某台设备的直接控制命令,且该命令的速率过低并达到安全限值时,将输出此信息。这是提示 速率已接近关断速率的警告。
| 费尔德 | Typ | 描述 |
|---|---|---|
session_id | int | 模拟会话的目标ID。 |
device_family | string | 设备类型: inverse oder简体中文(大陆) verse_grip. |
device_id | string | 该设备的唯一标识符。 |
frequency | int | 您当前的税率(以赫兹为单位)。 |
{
"name": "device-low-control-rate",
"category": "session",
"level": "warning",
"data": {
"session_id": 3,
"device_family": "inverse",
"device_id": "1A2B",
"frequency": 260
},
"message": ""
}
device-critical-control-rate
当接收到针对某台设备的传入直接控制命令时,若该命令的速率过低且触及安全限值,则会输出此信息。
| 费尔德 | Typ | 描述 |
|---|---|---|
session_id | int | 模拟会话的目标ID。 |
device_family | string | 设备类型: inverse oder简体中文(大陆) verse_grip. |
device_id | string | 该设备的唯一标识符。 |
frequency | int | 您当前的税率(以赫兹为单位)。 |
{
"name": "device-critical-control-rate",
"category": "session",
"level": "error",
"data": {
"session_id": 3,
"device_family": "inverse",
"device_id": "1A2B",
"frequency": 82
},
"message": ""
}
功能
sdf-sdf_hfx-created
在创建 SDF 实体的 FX 时输出此信息。
| 费尔德 | Typ | 描述 |
|---|---|---|
session_id | int | 模拟会话的目标ID。 |
device_id | string | 该设备的唯一标识符。 |
hfx_id | string | 用于创建该文件的 FX-ID。 |
{
"name": "sdf-sdf_hfx-created",
"category": "feature",
"level": "notice",
"data": {
"session_id": 3,
"device_id": "1A2B",
"hfx_id": "my_fx_name"
},
"message": ""
}
sdf-sdf_hfx-deleted
当 SDF 实体的 FX 被删除时,将输出此消息。
| 费尔德 | Typ | 描述 |
|---|---|---|
session_id | int | 模拟会话的目标ID。 |
device_id | string | 该设备的唯一标识符。 |
hfx_id | string | 已删除的 FX-ID。 |
{
"name": "sdf-sdf_hfx-deleted",
"category": "feature",
"level": "notice",
"data": {
"session_id": 3,
"device_id": "1A2B",
"hfx_id": "my_fx_name"
},
"message": ""
}
sdf-sdf_hfx-updated
当 SDF 实体的 FX 被更新时,会输出此内容。
| 费尔德 | Typ | 描述 |
|---|---|---|
session_id | int | 模拟会话的目标ID。 |
device_id | string | 该设备的唯一标识符。 |
hfx_id | string | 更新后的FX-ID。 |
{
"name": "sdf-sdf_hfx-updated",
"category": "feature",
"level": "notice",
"data": {
"session_id": 3,
"device_id": "1A2B",
"hfx_id": "my_fx_name"
},
"message": ""
}
sdf-sdf_hfx-range-entered
当指定设备的光标进入 SDF 实体的范围时,将输出此消息。
| 费尔德 | Typ | 描述 |
|---|---|---|
session_id | int | 模拟会话的目标ID。 |
device_id | string | 该设备的唯一标识符。 |
hfx_id | string | FX-ID。 |
{
"name": "sdf-sdf_hfx-range-entered",
"category": "feature",
"level": "notice",
"data": {
"session_id": 3,
"device_id": "1A2B",
"hfx_id": "my_fx_name"
},
"message": ""
}
sdf-sdf_hfx-range-exited
当指定设备的光标离开 SDF 实体的范围时,将输出此消息。
| 费尔德 | Typ | 描述 |
|---|---|---|
session_id | int | 模拟会话的目标ID。 |
device_id | string | 该设备的唯一标识符。 |
hfx_id | string | FX-ID。 |
{
"name": "sdf-sdf_hfx-range-exited",
"category": "feature",
"level": "notice",
"data": {
"session_id": 3,
"device_id": "1A2B",
"hfx_id": "my_fx_name"
},
"message": ""
}