This commit is contained in:
anlicheng 2025-03-07 13:30:06 +08:00
parent 98746b99ac
commit c1b3191b9c
2 changed files with 16 additions and 15 deletions

View File

@ -400,7 +400,9 @@ handle_event(cast, {handle, {data, Data}}, ?STATE_ACTIVATED, State = #state{aes
{keep_state, State};
%% ping的数据是通过aes加密后的
handle_event(cast, {handle, {ping, CipherMetric}}, ?STATE_ACTIVATED, State = #state{uuid = UUID, name = Name, aes = AES, has_session = true}) ->
handle_event(cast, {handle, {ping, CipherMetric}}, ?STATE_ACTIVATED, State = #state{uuid = UUID, name = Name, aes = AES,
heartbeat_counter = HeartbeatCounter, has_session = true}) ->
MetricsInfo = iot_cipher_aes:decrypt(AES, CipherMetric),
case catch jiffy:decode(MetricsInfo, [return_maps]) of
Metrics when is_map(Metrics) ->
@ -411,10 +413,10 @@ handle_event(cast, {handle, {ping, CipherMetric}}, ?STATE_ACTIVATED, State = #st
%%
iot_watchdog:detection(UUID, Name, Metrics),
{keep_state, State#state{metrics = Metrics}};
{keep_state, State#state{metrics = Metrics, heartbeat_counter = HeartbeatCounter + 1}};
Other ->
lager:warning("[iot_host] host_id: ~p, ping is invalid json: ~p", [UUID, Other]),
{keep_state, State}
{keep_state, State#state{heartbeat_counter = HeartbeatCounter + 1}}
end;
handle_event(cast, {handle, {inform, Info0}}, ?STATE_ACTIVATED, State = #state{uuid = UUID, host_id = HostId, aes = AES, has_session = true}) ->

View File

@ -1,21 +1,20 @@
# 事件分类
```text
11 23103 鼠类监测
13 20407 异物占道
14 10404 垃圾溢满
12 22503 后厨非标着装
15 23104 动火离人
16 22706 强弱电间违规进入
17 20863 作业人员抽烟监测
18 20864 作业人员手机使用监测
19 23105 挡鼠板监测
20 23106 垃圾桶加盖
21 22714 配电间人员进入监测
11 23103 鼠类监测
13 20407 异物占道
14 10404 垃圾溢满
12 22503 后厨非标着装
15 23104 动火离人
16 22715 强弱电间违规进入
17 20863 作业人员抽烟监测
18 20864 作业人员手机使用监测
19 23105 挡鼠板监测
20 23106 垃圾桶加盖
```
1、鼠类检测 0508103010001050300001 朴苑餐厅
2、异物占道 0512104030001050400003 行政楼B楼
3、垃圾溢满 0507106030001050600003 朴苑3舍
4、后厨非标着装 0500000000001022700537 监控摄像头532诚苑餐厅 北侧)
5、动火离人 0500000000001022700538 监控摄像头533诚苑餐厅 北侧)
5、动火离人 0500000000001022700538 监控摄像头533诚苑餐厅 北侧)