1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- package com.gzlh.device.infrared.handler.impl;
- import cn.hutool.core.util.StrUtil;
- import cn.hutool.extra.spring.SpringUtil;
- import com.gzlh.config.ModuleEnum;
- import com.gzlh.bus.EventBus;
- import com.gzlh.device.infrared.action.InfraredAction;
- import com.gzlh.device.infrared.brand.RedBrandType;
- import com.gzlh.device.infrared.handler.IRedHandler;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.stereotype.Service;
- @Service
- @Slf4j
- public class RedHandlerSoarDAM0404 implements IRedHandler {
-
- private final static String FIRST_BREAK_SIGNAL = "01 02 01 02 20 49";
-
- private final static String FIRST_LINK_SIGNAL = "01 02 01 03 E1 89";
- @Override
- public RedBrandType brandType() {
- return RedBrandType.SHANGHAI_YANGBAND_BX;
- }
- @Override
- public void handlerMsg(String content) {
- log.info(RedBrandType.SHANGHAI_YANGBAND_BX.getBrand() + "对红外处理消息:{}", content);
- content = StrUtil.replace(content, " ", "").toUpperCase();
-
- if (StrUtil.equals(StrUtil.replace(FIRST_BREAK_SIGNAL, " ", ""), content)) {
-
- }else if (StrUtil.equals(StrUtil.replace(FIRST_LINK_SIGNAL, " ", ""), content)){
- EventBus eventBus= SpringUtil.getBean(EventBus.class);
- eventBus.startEvent(ModuleEnum.INFRARED_MODULE.getModuleEn()+"."+ InfraredAction.IN_BREAK);
- }
- }
- @Override
- public void handlerAction(String action) {
- }
- }
|