Readme.md 3.3 KB

HDC Icontrols

Info

여러개의 플랫폼 연동 서비스를 제공하기 위한 이벤트 수신 및 전달 전용 브릿지

  • Java Application 으로 개발 하였습니다.
  • export한 jar 파일을 서비스 등록하여 배포합니다.
  • 서비스 등록을 위해서는 application.dat 파일이 존재해야 합니다.

라이브러리 등록

이 프로젝트는 Maven 혹은 gradle 프로젝트가 아니기 때문에 dependency를 등록할 수 가 없습니다. buildpath를 통해 라이브러리를 등록하세요.

지원하는 월패드 이벤트

이벤트명 이벤트 설명
msg_device_event 디바이스의 상태 변경 이벤트
msg_home_devices_status_event 디바이스 상태 주기보고 이벤트
msg_ararm_event 방범 알림 이벤트 (외출, 재중
msg_visitor_event 방문자 알림 이벤트
msg_notice_event 공지사항 알림 이벤트
msg_car_inout_event 입차 알림 이벤트
msg_box_event 택배 알림 이벤트
msg_energy_event 에너지 검침 이벤트
unsubscription 월패드 구독 해지 이벤트

지원하는 플랫폼 서비스

서비스명 Event 포트
Kakao 2222
Google 2223
kt 2224
UPLUS 2225
LGE 2226
SAMSUNG 2227
AMAZON 2228
APPLE 2229

서비스 등록

Linux

  1. /service/bridge 에 export한 bridge.jar 파일과 application.dat 파일을 업로드 합니다.
  2. 서비스를 등록합니다.

    $ cd /etc/systemd/system
    $ sudo vi bridge.service
    
    [Unit]
    Description=Event Bridge
    
    [Service]
    Type=simple
    User=valley
    ExecStart=/usr/bin/java -jar /service/bridge/bridge.jar
    WorkingDirectory=/service
    
    [Install]
    WantedBy=multi-user.target
    
  3. 서비스 데몬을 새로고침 합니다.

    $ sudo systemctl daemon-reload
    
    1. 서비스를 시작합니다. sh $ sudo systemctl start bridge.service

Windows

  • 추후 작성예정

설정파일

  • application.dat 파일을 통해 이벤트를 받을 플랫폼 서비스 정보를 추가해야 해당 플랫폼 서비스에서 이벤트를 수신할 수 있습니다.
  • application.dat 파일은 프로젝트의 COMMON_INFO.java 에 정의된 경로에 존재해야 합니다.
    public static final String LINUX_PROPERTIES_DIR = "/service/bridge/application.dat";
    public static final String WINDOWS_PROPERTIES_DIR = "D:\\temp\\bridge_jar\\application.dat";
  • application.dat 파일의 내용은 JSON 으로 작성 되었습니다. JSON 규격에 맞게 작성하여야 합니다.
  • 아래는 작성 예시입니다.
{
"name" : "uplus",
"address" : "10.0.1.1",
"port":	2225, 
"events" : [
            "msg_device_event",
            "msg_ararm_event",
            "msg_visitor_event",
            "msg_notice_event",
            "msg_car_inout_event",
            "msg_box_event",
            "unsubscription"
           ] 
}
  • 각 Field 정보
Field 명 Type Description
name String 플랫폼 명
address String IP Address
port Integer 이벤트 수신 용 Port
events list of String 수신받을 이벤트 목록