liusuyi
2026-05-30 f4f4fc53260eb67483dce406a963628273786a61
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package com.ard.gb28181.service;
 
import com.ard.gb28181.api.bean.ErrorCallback;
import com.ard.gb28181.api.bean.Preset;
import com.ard.gb28181.api.bean.SipTransactionInfo;
import com.ard.gb28181.api.domain.Device;
import com.ard.gb28181.api.domain.DeviceChannel;
 
import java.util.List;
 
/**
 * 设备相关业务处理
 *
 * @author lin
 */
public interface IDeviceService {
 
    /**
     * 查询设备信息
     *
     * @param deviceId 设备编号
     * @return 设备信息
     */
    Device getDeviceByDeviceId(String deviceId);
 
    /**
     * 设备上线
     *
     * @param device 设备信息
     */
    void online(Device device, SipTransactionInfo sipTransactionInfo);
 
    /**
     * 批量修改设备
     *
     * @param deviceList
     */
    void updateDeviceList(List<Device> deviceList);
 
    /**
     * 修改设备
     *
     * @param device
     */
    void updateDevice(Device device);
 
    /**
     * 设备下线
     *
     * @param deviceId 设备编号
     */
    void offline(String deviceId, String reason);
 
    /**
     * 更新设备心跳信息
     *
     * @param device
     */
    void updateDeviceHeartInfo(Device device);
 
    /**
     * 根据设备id和通道获取设备通道
     *
     * @param gbDeviceId
     * @param gbChannelId
     * @return
     */
    DeviceChannel getDeviceChannelByChannelId(String gbDeviceId, String gbChannelId);
 
    /**
     * 获取所有国标设备
     *
     * @return 设备列表
     */
    List<Device> getAllDevices();
 
    /**
     * 根据设备id获取所有通道
     *
     * @param gbDeviceId 设备编号
     * @return 通道列表
     */
    List<DeviceChannel> getChannelsByDeviceId(String gbDeviceId);
 
    /**
     * 通用前端控制命令(参考国标文档A.3.1指令格式)
     *
     * @param device       设备
     * @param channelId    通道国标编号
     * @param cmdCode      指令码(对应国标文档指令格式中的字节4)
     * @param parameter1   数据一(对应国标文档指令格式中的字节5, 范围0-255)
     * @param parameter2   数据二(对应国标文档指令格式中的字节6, 范围0-255)
     * @param combindCode2 组合码二(对应国标文档指令格式中的字节7, 范围0-15)
     */
    void frontEndCommand(Device device, String channelId, Integer cmdCode, Integer parameter1, Integer parameter2, Integer combindCode2);
 
    /**
     * 查询预置位
     *
     * @param device    设备国标编号
     * @param channelId 通道国标编号
     * @param callback
     */
    void queryPreset(Device device, String channelId, ErrorCallback<List<Preset>> callback);
}