@Component public class ChannelClientAPI extends Object
| 构造器和说明 |
|---|
ChannelClientAPI() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
closeChannel(String channelName,
Map<String,Object> channelParam)
关闭通道
|
ChannelRespondVO |
execute(ChannelRequestVO requestVO)
执行主从半双工操作:上位机向设备问询,并等待设备的回答,直到设备响应或者超时
|
ChannelRespondVO |
manageChannel(ChannelRequestVO requestVO)
对通道进行管理操作
|
void |
openChannel(String channelName,
Map<String,Object> channelParam)
打开通道
|
void |
publish(ChannelRequestVO requestVO)
执行发布操作:上位机向设备单向发送报文,不需要等待设备的返回
|
List<ChannelRespondVO> |
reportTo(long timeout)
设备的主动上报消息:设备向上位机
|
public ChannelRespondVO execute(ChannelRequestVO requestVO) throws ServiceException
requestVO - 请求报文ServiceException - 异常信息public void publish(ChannelRequestVO requestVO) throws ServiceException
requestVO - 发布报文ServiceException - 异常信息public List<ChannelRespondVO> reportTo(long timeout) throws ServiceException, InterruptedException
timeout - 等待超时ServiceException - 异常信息InterruptedException - 异常信息public void openChannel(String channelName, Map<String,Object> channelParam) throws Exception
channelName - 通道名称channelParam - 通道参数Exception - 异常public void closeChannel(String channelName, Map<String,Object> channelParam)
channelName - 通道名称channelParam - 通道参数public ChannelRespondVO manageChannel(ChannelRequestVO requestVO) throws ServiceException
requestVO - 操作请求ServiceException - 异常状况Copyright © 2024. All rights reserved.