KR20060071753A - Interfacing method between application and library of a master on home network - Google Patents

Interfacing method between application and library of a master on home network Download PDF

Info

Publication number
KR20060071753A
KR20060071753A KR1020040110729A KR20040110729A KR20060071753A KR 20060071753 A KR20060071753 A KR 20060071753A KR 1020040110729 A KR1020040110729 A KR 1020040110729A KR 20040110729 A KR20040110729 A KR 20040110729A KR 20060071753 A KR20060071753 A KR 20060071753A
Authority
KR
South Korea
Prior art keywords
library
command
home network
event
home
Prior art date
Application number
KR1020040110729A
Other languages
Korean (ko)
Inventor
김진영
Original Assignee
엘지전자 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 엘지전자 주식회사 filed Critical 엘지전자 주식회사
Priority to KR1020040110729A priority Critical patent/KR20060071753A/en
Priority to US11/317,226 priority patent/US20060230128A1/en
Publication of KR20060071753A publication Critical patent/KR20060071753A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines

Abstract

본 발명은, 홈 네트워크를 대상으로 운영되는 각종 어플리케이션과 라이브러리의 호환성을 확보할 수 있는 표준 인터페이싱 방법에 관한 것으로서, 본 발명에 의한 기기의 제어방법은, 어플리케이션이 네트워크에 연결된 기기를 제어하기 위한 함수루틴을 라이브러리에 호출하되, 제어할 기기의 식별정보와 제어를 위한 명령코드를 입력변수로 부가하여 호출하고, 상기 라이브러리가, 상기 명령코드에 의한 명령을 상기 기기의 식별정보에 의해 특정되는 기기에 대해 요청하고, 그 응답에 따른 결과값을 생성하여 상기 어플리케이션의 호출에 대해 리턴하게 된다.The present invention relates to a standard interfacing method that can ensure compatibility of various applications and libraries operated for a home network. The routine is called to the library, and the identification information of the device to be controlled and the command code for control are added as an input variable, and the library calls the command to the device specified by the identification information of the device. Then return the call to the application by generating a result according to the response.

홈네트워크, 라이브러리, 기기, 호출, 제어, 함수, 명령Home network, library, device, call, control, function, command

Description

홈 네트워크 마스터의 어플리케이션과 라이브러리의 인터페이싱 방법 {Interfacing method between application and library of a master on home network} Interfacing method between application and library of a master on home network}             

도 1은 본 발명에 따른 홈 네트워크 라이브러리와의 인터페이싱 방법에 적용되는 서버와 홈 네트워크의 구조를 개략적으로 도시한 것이고,1 schematically shows the structure of a server and a home network applied to an interfacing method with a home network library according to the present invention.

도 2는 도 1의 장치의 초기 구동시, 어플리케이션과 라이브러리간의 동작 수행절차를 도시한 것이고,FIG. 2 illustrates a procedure of performing an operation between an application and a library when the device of FIG. 1 is initially driven.

도 3a는 도 1의 라이브러리가 이벤트를 개별적으로 구분하여 처리하는 과정을 도시한 것이고,FIG. 3A illustrates a process in which the library of FIG. 1 separately classifies and processes an event.

도 3b는 도 1의 라이브러리가 모든 이벤트를 통합하여 처리하는 과정을 도시한 것이고,3b illustrates a process in which the library of FIG. 1 integrates and processes all events.

도 4는, 어플리케이션과 라이브러리간에 정의되는, 홈 네트워크의 기기를 개별적으로 조회/변경/제어하기 위해 필요한 커맨드의 구조를 예시한 것이고,4 illustrates a structure of a command necessary for individually inquiring / modifying / controlling devices of a home network defined between an application and a library,

도 5a내지 5c는 라이브러리가 홈 네트워크의 각 디바이스들에 홈 코드를 설정하는 과정을 예시한 것이고,5a to 5c illustrate a process in which a library sets a home code for each device of a home network,

도 6은 홈 네트워크상에서 하나의 디바이스에 주소가 할당되는 과정에 대한 흐름도이다.
6 is a flowchart illustrating a process of allocating an address to one device in a home network.

※ 도면의 주요부분에 대한 부호의 설명※ Explanation of code for main part of drawing

100: 제어 어플리케이션 110: 라이브러리100: control application 110: library

120: 물리적 인터페이스 200: 물리적 통신망120: physical interface 200: physical communication network

301, 302: 홈 네트워크 기기
301, 302: home network device

본 발명은, 홈 네트워크를 위한 서버에서 컨트롤 어플리케이션과 같은 프로그램이 네트워크에 있는 원격의 디바이스를 억세스하기 위한 라이브러리(Library)와의 인터페이싱 방법에 관한 것이다.
The present invention relates to a method of interfacing with a library for a program such as a control application in a server for a home network to access a remote device in a network.

댁내에는 많은 가전기기들의 보급되고 있어서, 이들의 집중관리하는 것이 필요해 지고 있다. 이러한 추세에 따라 홈 네트워크가 도입되고 있으며, 홈 네트워크를 구축하기 위한 물리적 망으로서 랜이나 전력선 통신 등이 제안되고 있다. 홈 네트워크에는 많은 전자제품들이 접속되고 이 전자제품들은 그 제조업체가 다를 수 있다.Many home appliances are spreading in the house, and it is necessary to concentrate their management. In accordance with this trend, a home network has been introduced, and LAN and power line communication have been proposed as a physical network for constructing a home network. Many electronics are connected to the home network, and these may be of different manufacturers.

제조업체가 다르면 홈 네트워크에 억세스할 수 있게 그 제품과 함께 제공하는 라이브러리도 또한 다를 수 있으며, 이 라이브러리가 다르면 컨트롤 프로그램과 같은 응용 어플리케이션과의 인터페이스도 또한 달라진다.Different manufacturers may also have different libraries provided with the product to access their home network, and different libraries also have different interfaces to applications such as control programs.

이와 같이 인터페이스 방법이 달라지면 응용 어플리케이션은 특정한 라이브러리가 동작하는 디바이스에서만 동작하게 되므로 호환성이 보장되지 못한다. 또한, 홈 네트워크를 위해 제공한 라이브러리 개발업체가 상이하면 응용 어플리케이션도 그에 맞추어 구입해야 하는 등의 호환성 문제도 발생한다.
In this way, if the interface method is different, the application will be operated only on the device in which a specific library operates, so compatibility is not guaranteed. In addition, if the library developers provided for the home network are different, compatibility problems arise, such as the need to purchase application applications accordingly.

따라서, 본 발명은, 홈 네트워크를 대상으로 운영되는 각종 어플리케이션과 라이브러리의 호환성을 확보할 수 있는 표준 인터페이싱 방법을 제공하는 것에 그 목적이 있다.
Accordingly, an object of the present invention is to provide a standard interfacing method that can ensure compatibility of various applications and libraries operated for a home network.

상기의 목적을 달성하기 위한 본 발명은, 홈 네트워크 기기의 목록을 조회하는 방법을 제공한다.The present invention for achieving the above object provides a method for querying a list of home network devices.

또한, 본 발명은, 홈 네트워크 기기의 상세정보를 조회하는 방법을 제공한다.The present invention also provides a method for inquiring detailed information of a home network device.

또한, 본 발명은, 홈 네트워크 기기의 목록 변경, 예를 들어 기기의 삭제, 추가 등을 행하는 방법을 제공한다.The present invention also provides a method of changing a list of home network devices, for example, deleting or adding a device.

또한, 본 발명은, 홈 네트워크의 마스터(서버)에서의 어플리케이션과 라이브러리간의 구동순서에 대한 방법을 제공한다.The present invention also provides a method for a driving sequence between an application and a library in a master (server) of a home network.

또한, 본 발명은, 홈 네트워크 기기의 상태를 변경 통지하는 방법을 제공한다.The present invention also provides a method of notifying change of a state of a home network device.

또한, 본 발명은, 홈 네트워크 기기의 상태를 개별적으로 확인하는 방법을 제공한다.The present invention also provides a method for individually checking the status of a home network device.

또한, 본 발명은, 홈 네트워크 기기를 개별적으로 제어하는 방법을 제공한다. The present invention also provides a method for individually controlling a home network device.                     

또한, 본 발명은, 홈 네트워크의 서버에서의 어플리케이션과 라이브러리간의 커맨드 동기를 위한 방법을 제공한다.The present invention also provides a method for command synchronization between an application and a library in a server of a home network.

또한, 본 발명은, 홈 네트워크의 구축시 필요한, 네트워크의 유일 식별자인 홈코드(home code)를 설정하는 방법을 제공한다.The present invention also provides a method for setting a home code, which is a unique identifier of a network, which is required for the construction of a home network.

또한 본 발명은, 홈 네트워크 기기의 주소를 설정/변경하는 방법을 제공한다.The present invention also provides a method for setting / changing an address of a home network device.

또한, 본 발명은, 홈 네트워크 기기의 동작옵션, 예를 들어 alive상태 보고주기, 시간, 이벤트 보고 활성화 등을 설정하는 방법을 제공한다.
The present invention also provides a method for setting an operation option of a home network device, for example, alive status report period, time, event report activation, and the like.

이하, 본 발명에 따른 홈 네트워크 라이브러리와의 인터페이싱 방법에 대해 상세히 설명한다.Hereinafter, a method of interfacing with a home network library according to the present invention will be described in detail.

도 1은 본 발명에 따른 홈 네트워크 라이브러리와의 인터페이싱 방법에 적용되는 서버와 홈 네트워크의 구조를 개략적으로 도시한 것이다.1 schematically illustrates the structure of a server and a home network applied to an interfacing method with a home network library according to the present invention.

본 발명에 따른 인터페이싱 방법이 적용되는 서버는, 홈 네트워크의 운영 프로그램과 같은 사용자 어플리케이션(100), 홈 네트워크를 억세스하기 위한 필요한 모든 함수와 실행 루틴들이 포함되어 있는 라이브러리(110)( 이 라이브러리는 LnCP( Living Network Control Protocol) 라이브러리로도 호칭된다 ), 전력선 또는 랜 케이블과 같은 물리적 통신망(200)에 접속하기 위한 물리적 인터페이스(120)를 포함한다. 그리고, 도 1의 홈 네트워크에는 상기 서버에 의해 제어되는 원격 디바이스(301,302)도 도시되어 있다. 이 들 디바이스는 상기 라이브러리(110)의 실행루 틴에 의해 그 상태가 조회, 변경 및/또는 제어되며, 이러한 동작을 위한 명령 등은 상기 사용자 어플리케이션( 이하, 제어 어플리케이션이라 함 )(100)에서 상기 라이브러리(110)의 API의 정의에 따라 호출되는 데 이하에서는 이에 대해서 상세히 설명한다.The server to which the interfacing method according to the present invention is applied includes a user application 100 such as an operation program of a home network, a library 110 including all necessary functions and execution routines for accessing a home network (this library is LnCP). (Also referred to as a Living Network Control Protocol) library, a physical interface 120 for connecting to a physical communication network 200, such as a power line or a LAN cable. Also shown in the home network of FIG. 1 are remote devices 301 and 302 controlled by the server. These devices are inquired, changed, and / or controlled by the execution routine of the library 110, and commands for such an operation are performed by the user application (hereinafter referred to as a control application) 100. Called according to the definition of the API of the library 110, which will be described in detail below.

먼저, 서버가 홈 네트워크에 살아있는 디바이스를 조회하는 방법에 대해 설명한다.First, a description will be given of how the server queries a live device in a home network.

상기 제어 어플리케이션(100)은 홈 네트워크에 연결된 기기의 목록을 알기 위해 상기 라이브러리(110)에 다음의 함수 콜을 한다. The control application 100 makes the following function call to the library 110 to know the list of devices connected to the home network.

get_active_device_list(&active_device_list); get_active_device_list (&active_device_list);

그러면, 상기 라이브러리(110)는, Input argument( 즉, &active_device_list(active_device_list의 포인터) )에 네트워크에 살아있는(활성화된) 디바이스들의 정보를 실는다. 정보를 실는 리스트내에는 총 디바이스의 개수와 디바이스 리스트가 있는 데, 각 디바이스에 대한 정보의 구조는 다음과 같다.Then, the library 110 loads information of devices that are alive (activated) on the network in an input argument (ie, & active_device_list (pointer to active_device_list)). The list of information contains the total number of devices and the device list. The structure of the information for each device is as follows.

typedef struct device {typedef struct device {

device_descriptor_t dd;device_descriptor_t dd;

device_type_t device_type;device_type_t device_type;

device_mode_t device_mode;device_mode_t device_mode;

} device_t;} device_t;

리스트 개개의 기기 정보는 프로토콜 인덱스, device descriptor의 정보, 그 유형 그리고 모드정보를 포함한다. 유형정보는 그 기기의 종류, 예를 들면 냉장 고 또는 세탁기와 같은 것을 지정하는 것이고, 모드 정보는 그 기기가 마스터인지 슬레이브인지를 지정하는 값이다.Each device information in the list includes a protocol index, device descriptor information, its type, and mode information. The type information specifies the type of device, such as a refrigerator or a washing machine, and the mode information is a value specifying whether the device is a master or a slave.

한편, 상기 라이브러리(110)는 살아있는 디바이스의 정보를 상기 제어 어플리케이션(100)에 전달할 때, 각 살아있는 디바이스 각각에 대해 필요한 메모리 공간을 위해 내부 메모리를 할당한다.On the other hand, when the library 110 transmits the information of the living device to the control application 100, the internal memory is allocated for the memory space required for each of the living devices.

이후, 상기 제어 어플리케이션(100)이 살아있는 디바이스들의 사용( 또는 제어 )의 필요성이 없을 때는 라이브러리(110)에 할당된 메모리를 해제하도록 하기 위해 다음의 명령에 의해 active_list 를 해제한다Then, when the control application 100 does not need to use (or control) the live devices, the active_list is released by the following command to release the memory allocated to the library 110.

release_active_device_list(&active_device_list);release_active_device_list (&active_device_list);

다음으로, 서버가 홈 네트워크에 살아있는 디바이스를 좀 더 상세히 조회하는 방법에 대해 설명한다.Next, we'll explain how the server can look up live devices on the home network in more detail.

이 때는, 상기 제어 어플리케이션(100)은 다음 함수를 이용하여 리턴값에 주소, 디바이스 종류, 모델명, 위치 정보를 상기 라이브러리(110)가 실도록 함으로써 요청한 디바이스에 대해 상세히 조회할 수 있다.In this case, the control application 100 may inquire about the requested device in detail by causing the library 110 to load an address, a device type, a model name, and location information in a return value using a following function.

get_device_info_by_dd(device_descriptor_t dd, device_info_t *ret_entry)get_device_info_by_dd (device_descriptor_t dd, device_info_t * ret_entry)

여기서, dd는 디바이스를 네트워크상에서 유일하게 식별케하는 정보( device descriptor )이며, ret_entry의 포인터에는 다음 구조를 갖는 정보가 상기 라이브러리(110)에 의해 실린다.Here, dd is information (device descriptor) uniquely identifying a device on a network, and the library 110 carries information having the following structure in a pointer of ret_entry.

typedef struct device_info{typedef struct device_info {

device_descriptor_t dd; device_descriptor_t dd;                     

unsigned short address;unsigned short address;

device_type_t device_type; device_type_t device_type;

char model[MAX_MODEL_NAME_LEN];char model [MAX_MODEL_NAME_LEN];

unsigned char location; unsigned char location;

} device_info_t;} device_info_t;

address는 유형(type)과 그 유형에서의 일련번호가 조합된 값이며, model은 그 모델명이 실리는 텍스트이며, location은 댁내에 위치한 곳에 대한 정보이다. 예를 들면, 거실, 안방 등이다.address is a combination of type and serial number of the type, model is the text of the model name, and location is information about where the home is located. For example, a living room, a bedroom, etc.

상기와 같은 조회 명령에 의해 특정 디바이스에 대한 정보를 획득하면 상기 제어 어플리케이션(100)은 사용자가 요청하는 적당한 제어 명령을 상기 라이브러리(110)에 호출하고, 해당 디바이스에 대한 정보가 필요없다고 판단되면 그 디바이스를 해제하는 명령을 상기 라이브러리(110)에 호출함으로써, 상기 라이브러리(110)가 할당해 둔 메모리를 다른 용도로 다시 사용할 수 있게 한다.When the control application 100 obtains information on a specific device by the inquiry command as described above, the control application 100 calls the appropriate control command requested by the user to the library 110, and if it is determined that the information on the corresponding device is not necessary, By calling a command to release the device to the library 110, the memory allocated by the library 110 can be used again for another purpose.

다음으로, 상기 제어 어플리케이션(100)이 특정 디바이스를 홈 네트워크상에서 제거하는 방법에 대해 설명한다.Next, a description will be given of how the control application 100 removes a specific device on a home network.

상기 제어 어플리케이션(100)은 디바이스 삭제 이벤트와 그 이벤트의 발생시 콜백 받을 함수를 다음 함수를 호출함에 의해 상기 라이브러리(110)에 등록한다.The control application 100 registers the device deletion event and a function to be called back when the event occurs in the library 110 by calling a next function.

add_sys_event_func_entry(EVT_SYSTEM_PLUG_OUT, plugout_event_handler);add_sys_event_func_entry (EVT_SYSTEM_PLUG_OUT, plugout_event_handler);

상기 라이브러리(110)는 홈 네트워크상에서 EVT_STSTEM_PLUG_OUT( 플러그 아웃 이벤트로 지정된 값 )의 이벤트가 발생하면 상기 등록한 콜백 함수 (plug_out_event_handler)를 호출한다. 이 때, 그 호출된 함수의 입력변수에 dd(device descriptor or protocol index)값을 싣는다. 즉, 다음과 같이 상기 라이브러리(110)로 부터 상기 제어 어플리케이션(100)내의 루틴이 호출된다.The library 110 calls the registered callback function (plug_out_event_handler) when an event of EVT_STSTEM_PLUG_OUT (value designated as a plug-out event) occurs on the home network. At this time, dd (device descriptor or protocol index) is loaded into the input variable of the called function. That is, the routine in the control application 100 is called from the library 110 as follows.

plugout_event_handler (sys_event_value_t dd);plugout_event_handler (sys_event_value_t dd);

그러면, 상기 plugout_event_handler 루틴은 해당 기기를 자신이 관리하고 있는 디바이스 리스트에서 삭제한다.Then, the plugout_event_handler routine deletes the device from the device list managed by the device.

만약, 상기와 같은 삭제 이벤트의 상기 라이브러리(110)에의 등록 후, 디바이스 삭제 이벤트를 더 이상 받고 싶지 않으면 이미 등록시킨 콜백 함수를 다음과 같은 함수 호출에 의해 해제 한다. 해제하는 것은 해제 함수의 인자값에 해제하고 싶은 이벤트, 콜백받을 등록 함수를 입력한다.If, after registering the deletion event in the library 110, the device deletion event is no longer desired, the callback function that has already been registered is released by the following function call. To release, enter the event you want to release in the argument value of the release function and the registration function to receive the callback.

del_sys_event_func_entry(EVT_SYSTEM_PLUG_OUT, plugout_event_handler);del_sys_event_func_entry (EVT_SYSTEM_PLUG_OUT, plugout_event_handler);

디바이스의 추가인 경우는 디바이스 삭제 이벤트 등록 및 콜백함수에 의한 실행과정과 동일하지만 호출할 때 사용하는 추가하는 이벤트의 값(EVT_SYSTEM_ACTIVE_DEVICE_ADD)이 다르고 또한, 추가 이벤트 처리를 위한 콜백루틴에서는 디바이스가 추가 되었다는 것을 사용자에게 알려주거나 추가된 것에 대한 처리를 해준다.In case of adding device, it is same as the process of device deletion event registration and execution by callback function, but the value of additional event (EVT_SYSTEM_ACTIVE_DEVICE_ADD) to be used when calling is different. Also, callback routine for additional event processing indicates that device is added. Inform the user or handle the addition.

네트워크에 기기가 다시 연결되었을때를 위한 처리과정은 위의 디바이스 추가와 동일하고 (이벤트 값도 EVT_SYSTEM_ACTIVE_DEVICE_ADD를 사용) 사용자 처리는 동일 또는 매우 유시하다. 즉, 사용자에게 알려주는 메시지가 다소 상이할 수 있다. The process for when the device is reconnected to the network is the same as adding the device above (using EVT_SYSTEM_ACTIVE_DEVICE_ADD for event values) and user processing is the same or very similar. That is, the message informing the user may be slightly different.                     

한편, 도 1의 서버내의 제어 어플리케이션과 라이브러리간의 동작이 정상적으로 이루어지기 위해서는 상호간의 함수호출이나 정보의 교환이 정해진 절차에 따라 이루어져야 이후의 동작이 정상적으로 수행될 수 있다.Meanwhile, in order for the operation between the control application and the library in the server of FIG. 1 to be normally performed, the function call or the exchange of information should be performed according to a predetermined procedure so that the subsequent operation can be normally performed.

도 2는 이에 대한 실시예의 흐름도이다. 먼저, 상기 제어 어플리케이션(100)은 구동되면 필요한 사용자 UI를 구동한다(S21). 그리고, 상기 라이브러리(110)의 초기화를 요청한다(S22). 이 때, 제어할 각 디바이스들에 대한 기본 정보들( 예를 들어, 통신포트, 그 포트의 baudrate 등 )이 라이브러리(110)에 전달된다. 그리고, 앞서 설명한 바와 같이, 살아있는 디바이스들을 조회하고 이들에 대한 초기화를 요청한다(S23). 또한, 처리할 이벤트, 예를 들어 플러그-인 또는 플러그-아웃 등과 그들에 대한 이벤트 핸들러, 즉 콜백 함수들을 각가 등록한다(S24). 이와 같은 과정이 순서대로 수행되고 나면, 상기 LnCP 라이브러리(110)는 홈 네트워크상에서 각조 디바이스들로 부터 이벤트가 발생되면, 자신에게 등록된 해당하는 콜백함수를 호출함으로써 이벤트에 대한 적절한 동작이 이루어지도록 한다(S25).2 is a flowchart of an embodiment thereof. First, when the control application 100 is driven (S21) to drive the user UI required. The library 110 requests initialization of the library 110 (S22). At this time, basic information (eg, communication port, baudrate, etc.) of each device to be controlled is transmitted to the library 110. As described above, the living devices are inquired and a request for initialization thereof is provided (S23). In addition, each event registers an event handler to be processed, for example, a plug-in or a plug-out and the like, and event handlers for them, that is, callback functions (S24). After this process is performed in order, the LnCP library 110 when the events are generated from each device on the home network, by calling the corresponding callback function registered to the appropriate action for the event is made. (S25).

만약, 상기 제어 어플리케이션(100)은 필요하다면 자신이 등록한 이벤트 및 함수를 해제시키기 위한 함수호출을 수행할 수도 있다.If necessary, the control application 100 may perform a function call to release an event and a function registered by the control application 100.

다음으로, 디바이스의 상태가 변경통지되게 하는 방법에 대해 설명한다. 홈네트워크의 기능을 지원하는 기기의 경우, 디바이스의 상태(예를 들어 전원 상태, 동작 상태, 온도값, 운전모드, 선택코스 등)가 변경되면 디바이스 자체적으로 이벤트를 발생시키도록 되어 있는 데, 이벤트 발생시에는 이벤트의 유형을 알려주는 이벤트 코드와 그 이벤트가 발생한 상태의 값인 이벤트 값이 전달된다. Next, a description will be given of a method of causing the device state to be notified of change. In the case of a device that supports the function of the home network, the device itself generates an event when the state of the device (for example, power state, operating state, temperature value, operation mode, selection course, etc.) changes. When an event occurs, the event code indicating the type of event and the event value, which is the value of the event occurrence state, are delivered.                     

이를 위해서, 먼저, 상기 제어 어플리케이션(100)은 상기 라이브러리(110)에 해당 이벤트를 처리하기 위한 이벤트 콜백함수를 등록한다. 이벤트를 처리하는 콜백함수는 각각의 이벤트를 처리하는 경우와 모든 이벤트를 받아서 처리하는 경우 두 가지로 나뉠 수 있다.To this end, first, the control application 100 registers an event callback function for processing a corresponding event in the library 110. Callback functions that handle events can be divided into two types: one for handling individual events and one for receiving and processing all events.

첫째, 각각의 이벤트를 처리하는 경우는 다음과 같이 정의된 user_event_func_t 타입의 함수를 device descriptor 'dd'와 event code 'ec'로 상기 라이브러리(110)에 등록한다.First, in case of processing each event, a user_event_func_t type function defined as follows is registered in the library 110 with device descriptor 'dd' and event code 'ec'.

typedef void(*user_event_func_t) (event_value1_t event_value);typedef void (* user_event_func_t) (event_value1_t event_value);

int add_event_handler(device_descriptor_t dd, event_code_t ec, user_event_func_t uefunc);int add_event_handler (device_descriptor_t dd, event_code_t ec, user_event_func_t uefunc);

여기서 ec는 상기 라이브러리(110)로부터 보고받을 이벤트의 유형에 대한 것이며, uefunc는 콜백함수의 포인터이다.Where ec is the type of event to be reported from the library 110, uefunc is a pointer to the callback function.

상기 라이브러리(110)은 어떤 event가 발생되면, 자신이 관리하고 있는 hash table에서 device descriptor와 event code를 찾아서 해당 function, 즉, 등록된 uefunc의 포인터를 호출함으로써 콜백한다( 도 3a의 301과정 ). 이 때, uefunc의 입력변수로서 'event_value'를 싣는다. 이는 이벤트가 발생한 상태값인 데, 이 값에 따라서 상기 제어 어플리케이션(110)은 사용자에게 알려주거나 그 값에 대해 지정된 적절한 동작이 있으면 이를 수행한다.When an event occurs, the library 110 finds a device descriptor and an event code from a hash table managed by the library 110 and calls back by calling a pointer of a corresponding function, that is, registered uefunc (step 301 of FIG. 3A). At this time, 'event_value' is loaded as an input variable of uefunc. This is a state value in which an event has occurred. According to this value, the control application 110 notifies a user or performs an appropriate action specified for the value.

둘째, 모든 이벤트를 처리하기 위해서는 경우는 다음과 같이 정의된 user_all_event_func_t 타입의 함수를 상기 라이브러리(110)에 등록한다. Second, in order to process all events, the user_all_event_func_t type function defined as follows is registered in the library 110.                     

typedef void (*user_all_event_func_t) (unsigned short device_addr, unsigned char size, unsigned char *event_data);typedef void (* user_all_event_func_t) (unsigned short device_addr, unsigned char size, unsigned char * event_data);

int add_all_event_handler(user_all_event_func_t func);int add_all_event_handler (user_all_event_func_t func);

이 함수가 상기 라이브러리(110)에 등록되면, 네트워크상의 어떤 디바이스로부터 어떤 이벤트가 발생되어도,상기 라이브러리(110)는 항상 user_all_event_func_t로 정의된 함수 'func'를 콜백한다( 도 3b의 302과정 ). 대신, 상기 라이브러리(110)가, 그 이벤트를 발생시킨 디바이스를 특정하고 이벤트를 확인할 수 있도록 device_addr( 홈 네트워크에서 하나의 디바이스를 특정하기 위한 유형 및 일련번호에 대한 것 )와 *event_data를 입력변수로 하여 콜백한다. event_data의 포인터에는 이벤트의 코드와 값이 포함될 수 있다.When this function is registered in the library 110, no matter what event occurs from any device on the network, the library 110 always calls back the function 'func' defined by user_all_event_func_t (step 302 of FIG. 3B). Instead, device_addr (for type and serial number for specifying one device in the home network) and * event_data are input variables so that the library 110 can identify the device that triggered the event and identify the event. Call back. The pointer of event_data may include the code and value of the event.

콜백된 상기 제어 어플리케이션(100)내의 루틴은 받은 parameter의 정보에 근거하여 해당 event를 적절히 처리하는 과정을 수행하게 된다.The routine in the callback control application 100 performs a process of appropriately processing the event based on the received information of the parameter.

다음으로, 상기 제어 어플리케이션(100)이 상기 라이브러리(110)의 루틴 호출을 통해 디바이스를 개별적으로 제어하는 방법에 대해서 설명한다.Next, a description will be given of a method in which the control application 100 individually controls devices through routine calls of the library 110.

먼저, 상기 제어 어플리케이션(100)에서 상기 라이브러리(110)내의 디바이스 제어 함수를 호출하기 위해서는 다음과 같은 정보가 정해져야한다. First, in order to call the device control function in the library 110 from the control application 100, the following information should be determined.

먼저, 제어하고자하는 디바이스의 ID(device descriptor)와 수행하고자 하는 명령의 command code를 알고 있어야 한다. command code는 라이브러리 내부적으로 제공할 수도 있다. 그리고, 각 제어의 특징상 필요한 input parameter, 예를 들어 세탁기를 전원을 제어하기 위해서는 전원을 켜는지(POWER_ON) 전원을 끄는지 (POWER_OFF)에 대한 argument를 입력하여야 한다.First, the ID (device descriptor) of the device to be controlled and the command code of the command to be executed must be known. The command code may be provided internally in the library. In order to control the power supply of the washing machine, for example, an argument regarding a power input (POWER_ON) or a power off (POWER_OFF) must be input.

사용자 프로그램의 특성에 따라 해당 명령의 수행이 모두 끝난 후에 응답을 받을지(Synchronize mode), 명령이 전달되면 바로 함수를 return 할지(Asynchronize mode)와 Synchronize mode에서 응답을 받을때까지 기다릴 시간과 같은 command option이 필요하다.Depending on the characteristics of the user program, command options such as whether to receive a response after the execution of the command is completed (Synchronize mode), to return the function immediately when the command is delivered (Asynchronize mode), and to wait for a response in Synchronize mode. This is necessary.

상기와 같이 필요한 argument가 부가되어 디바이스 제어함수가 호출되면, 상기 라이브러리(110)는 그 argument를 도 4에 정의된 command option을 command_t의 구조체에 담아서 내부 control_device 함수를 호출한다.When the necessary device argument is added and the device control function is called, the library 110 calls the internal control_device function by including the command option defined in FIG. 4 in the structure of command_t.

도 4의 command_t의 구조에는, 명령코드(cc), command_args_t의 구조(401)를 갖는 args변수( 명령에 따른 입력변수의 스트링(string) ), command_ret_t구조(402)를 갖는 rets변수( 스트링 ), 그리고 command_option_t의 구조( 이에 대해서는 후술한다 )를 갖는 option변수가 포함되는 데, 입력변수 cc, args, 그리고 option의 값은 사용자 입력에 근거하여 결정된다. 그리고, command_args_t의 구조(401)와 command_ret_t구조(402)내의 var_arg와 var_ret의 필드는 명령과 응답시에 부가되는 메시지에 대한 포인터이이다.In the structure of command_t of FIG. In addition, an option variable having a structure of command_option_t (described later) is included. Input variables cc, args, and option values are determined based on user input. The fields of var_arg and var_ret in the structure 401 of the command_args_t structure and the command_ret_t structure 402 are pointers to messages added to commands and responses.

해당 내부 control_device 함수에서는 제어하는 디바이스의 주소와 command code를 key로 하여 응답을 처리할 함수를 등록한 후, 실제 디바이스를 제어하기 위한 프로토콜 패킷을 생성하여 Physical Interface(200)를 통해서 디바이스(301 또는 302)로 전송한다.The internal control_device function registers a function to process a response using the address of the controlling device and a command code as a key, and then generates a protocol packet for controlling the actual device to generate the protocol packet for the device 301 or 302 through the physical interface 200. To send.

상기 패킷의 전송 후에 응답을 받으면, 앞서 등록한 응답을 처리할 함수를 호출하여 해당 응답을 처리하는 데, 만약 디바이스로부터 받은 응답에 필요한 정보가 있으면, 이를 command_t의 구조체에 담아서 리턴한다. 이 return에 의해 제어권을 넘겨받은 디바이스 제어 함수에서는, command_t의 구조체를 풀어 해당 함수의 output parameter에 담은 다음, 제어 결과와 output parameter를 상기 제어 어플리케이션(100)으로 리턴함으로써 사용자가 요청한 또는 상기 제어 어플리케이션(100)이 요청한 개별 디바이스에 대한 제어동작을 완료한다.If a response is received after the packet is transmitted, a function that processes the previously registered response is called to process the response. If there is information necessary for the response received from the device, the packet is returned in a structure of command_t. In the device control function transferred to the control right by this return, the structure of command_t is unpacked and stored in the output parameter of the corresponding function, and then the control result and the output parameter are returned to the control application 100 so as to be requested by the user or the control application ( Complete the control operation for the individual device requested by 100).

다음으로, 상기 제어 어플리케이션(100)이 상기 라이브러리(110)의 루틴 호출을 통해 개별 디바이스의 상태를 조회하는 방법에 대해서 설명한다.Next, a description will be given of how the control application 100 inquires the status of individual devices through routine calls of the library 110.

개별 디바이스의 상태 조회는 앞서 개별적으로 디바이스를 제어하는 방법과 다음의 점을 제외하고는 동일하다.Status inquiry of an individual device is the same as the method of controlling an individual device previously, except for the following points.

디바이스의 조회(모니터링) 함수는 디바이스에서 해당 명령의 수행이 모두 끝난 후에 응답을 받아야 하므로 항상 동기(synchronized) 모드여야 하며, 따라서, 응답을 받을 때까지 기다릴 시간을 지정해야할 필요가 있다. 명령의 모드와 시간의 지정은 다음과 같은 구조의 command option으로 주어진다.Since the device's inquiry (monitoring) function must receive a response after all the commands are executed in the device, it should always be in synchronized mode, and therefore, it is necessary to specify a time to wait for the response. The mode and time of the command is given as a command option with the following structure:

typedef struct command_option {typedef struct command_option {

unsigned char async;unsigned char async;

unsigned long wait_time; // sec. 단위unsigned long wait_time; // sec. unit

} command_option_t;} command_option_t;

async는 SYNC_COMMAND또는 ASYNC_COMMAND로 지정하는 값( 0 또는 1 )을 가지며, SYNC_COMMAND는 사용자( 제어 어플리케이션(100) )가 명령을 보내고 그 명령에 대한 답변을 기다리겠다는 뜻이며, ASYNC_COMMAND는 사용자가 명령을 보내고 그 명령에 대한 답변을 기다리지 않겠다는 의미이다. async has a value (0 or 1) that you specify as SYNC_COMMAND or ASYNC_COMMAND, SYNC_COMMAND means that you (the control application 100) want to send a command and wait for an answer to that command, and ASYNC_COMMAND means that you send the command This means not waiting for an answer to the command.

async의 값을 SYNC_COMMAND로 설정을 하는 경우는, 명령을 보낸 시간부터 시작해서 wait_time에 설정된 시간만큼 기다리고 그 안에 답변이 오면 정상 종료, 그렇지 않으면 상기 제어 어플리케이션(100)은 TIME OUT의 이벤트에 따른 동작을 실행하게 된다. async의 값이 ASYNC_COMMAND일 때 wait_time의 값은 상기 라이브러리(110)에 의해 무시된다.When setting the value of async to SYNC_COMMAND, it starts from the time when the command is sent and waits for the time set in wait_time, and if there is an answer in it, it terminates normally. Will run. The value of wait_time is ignored by the library 110 when the value of async is ASYNC_COMMAND.

상기 제어 어플리케이션(100)과 라이브러리(110)간에 전체 커맨드에 대한 옵션을 공유하기 위해 command_option_t에 의한 구조체를 다음과 같이 전역(global) 변수로 지정하여 이용할 수도 있다. In order to share options for the entire command between the control application 100 and the library 110, a structure by command_option_t may be designated as a global variable as follows.

static command_option_t *func_optionstatic command_option_t * func_option

또한, 상기 제어 어플리케이션(100)과 라이브러리(110)간에 동시에 요청되는 명령들이 다수일 수 있으므로, command_option의 구조를 다음과 같이, 그 옵션을 갖는 커맨드를 식별케하는 커맨드 코드를 더 포함하게 할 수 있다.In addition, since there may be a plurality of commands simultaneously requested between the control application 100 and the library 110, the structure of command_option may further include a command code for identifying a command having the option as follows. .

typedef struct command_option {typedef struct command_option {

unsigned char cc; // 커맨트 코드unsigned char cc; // comment code

unsigned char async;unsigned char async;

unsigned long wait_time; // sec. 단위unsigned long wait_time; // sec. unit

} command_option_t;} command_option_t;

이와 같이 정의하여 사용하면, 광역변수로 커맨드 옵션을 사용하여도 커맨트 별로 구분하여 상기 제어 어플리케이션(100)과 상기 라이브러리(110)간에 해당 명령이 동기 또는 비동기로 적절히 동작할 수 있다.When defined and used as described above, even if a command option is used as a global variable, the command can be appropriately operated synchronously or asynchronously between the control application 100 and the library 110 according to the command.

이하에서는, 홈 네트워크를 초기 또는 변경설정하는 방법에 대해 상세히 설명한다.Hereinafter, a method for initializing or changing the home network will be described in detail.

먼저, 홈 네트워크를 초기 설정하는 방법에 대해 설명한다. First, a description will be given of how to initially set up a home network.

한 집안의 독립적인 네트위크를 구성하기 위해서 홈코드(Home Code)라는 것을 사용한다. 홈코드는 그 집의 유일하고 독립적인 코드 로서 홈코드가 같은 홈네트워크 기기끼리만 통신이 되게 된다. 이러한 Home code는 사용자의 요청에 따라 상기 제어 어플리케이션(100)이 상기 라이브러리(110)에 다음과 같은 함수를 호출하여 설정을 하게 된다.To form an independent network in a home, you use what is called a home code. The home code is the only independent code in the house, and only home network devices with the same home code can communicate with each other. The home code is set by the control application 100 calling the following function to the library 110 at the request of the user.

int set_home_code();int set_home_code ();

상기 호출에 의해 상기 라이브러리(110)는 도 5a의 과정을 수행하는 데, 먼저 디바이스들로부터 응답이 있는 메시지, 예를 들면 기기의 이름을 요청하는 메시지를 물리적 네트워크(200)를 통해 방송한다(S51). 이 메시지에는 물리적 인터페이스(120)에 설정되어 있는 홈코드가 사용되는 데, 만약, 이 방송 메시지에 대해 응답이 있으면(S52), 기기의 추가인 경우, 홈코드를 설정하는 방송 메시지를 송출하고(S56), 그렇지 않으면 상기 물리적 인터페이스(120), 예를 들어 전력선 모뎀에 홈코드를 생성하라는 명령을 내리고(S53), 다시 응답이 필요한 메시지, 즉, 이름 요청 메시지를 네트워크를 통해 방송한다(S54). 이 때, 응답이 있으면(S55), 방금 생성된 홈코드가 어디선가 사용이 되고 있음을 의미하므로 재생성 과정을 수행하게 되고(S53,S54), 그렇지 않으면 생성된 홈코드를 설정하라는 방송 메시지를 홈 네트워크를 통해 송출한다(S56).In response to the call, the library 110 performs the process of FIG. 5A, and first broadcasts a message with a response from the devices, for example, a message requesting the name of a device, through the physical network 200 (S51). ). In this message, the home code set in the physical interface 120 is used. If there is a response to the broadcast message (S52), when the device is added, a broadcast message for setting the home code is transmitted (S52). Otherwise, otherwise, the physical interface 120, for example, the power line modem to give a command to generate a home code (S53), and broadcasts a message that requires a response, that is, a name request message over the network (S54) . At this time, if there is a response (S55), it means that the just-generated home code is being used somewhere, so the regeneration process is performed (S53, S54). It transmits through a network (S56).

이와 같은 과정에 의해, 홈 네트워크가 전력선을 통해 타 댁내의 가전기기들과 연결되어 있더라도 그 댁내에 유일하고 고유한 홈코드가 설정됨으로써, 그 댁내의 기기들끼리만 통신할 수 있게 된다.By this process, even if the home network is connected to other home appliances through a power line, a unique and unique home code is set in the home, so that only the devices in the home can communicate.

도 5b는 상기의 과정에서 홈 네트워크가 최초설정되는 것인지 새 기기의 추가인 것인지를 판별하는 과정의 상세 흐름도이다.5B is a detailed flowchart of a process of determining whether a home network is initially set up or addition of a new device in the above process.

앞서 언급한 바와 같이, 홈 코드를 설정 할 때는 최초로 네트워크를 설치 하는 경우인지, 아니면 새로운 기기가 추가 되어서 홈코드를 설정하는 것인지에 따라 설정 방법이 다르다. 여기서 최초로 네트워크를 설치 하는 것인지, 새로운 기기를 추가하는 것인지에 대한 판단은, 예를 들어 이름 요청명령을 3회 보내서(S502) 응답하는 것이 있으면(S503,S504), 새로운 기기를 추가하는 경우라고 판단하고(S506), 응답이 없으면 처음으로 네트워크를 설치하는 것으로 판단하고 동작한다(S505). As mentioned earlier, the way you set up your home code differs depending on whether you are setting up your network for the first time or setting up your home code with a new device. The determination of whether to install the network for the first time or to add a new device is, for example, if it sends a name request command three times (S502) and responds (S503, S504), it is determined that a new device is added. If there is no response (S506), it is determined that the network is installed for the first time and is operated (S505).

도 5c는 도 5a의 S53내지 S55의 과정을 보다 상세히 도시한 흐름도이다. 최초로 Network을 설치 하는 경우 일 때는, 물리적 인터페이스(120), 예를 들어, 홈 네트워크용 모뎀에게 새로운 홈 코드를 생성하도록 하고(S511) 새로이 만든 홈코드가 다른 네트워크의 홈코드와 중복이 되지 않는지 확인을 한 다음, 그 홈코드를 방송하여서 다른 홈 네트워크용 모뎀도 그 홈코드를 설정하게 만든다. 홈코드가 중복된 홈코드인지 아닌지는 이름 요청(Name Request) 패킷(Packet)을 보내서(S513) 판단하게 된다. 이름 요청 메시지의 응답메시지에 대한 핸들러(handler)를 메시지 송출전 미리 테이블에 등록한다(S512). 이 핸들러가 응답 메시지에 대한 루틴(S515)를 수행한다.FIG. 5C is a flowchart illustrating the process of S53 to S55 in FIG. 5A in more detail. When installing the network for the first time, the physical interface 120, for example, to generate a new home code to the home network modem (S511) and check that the newly created home code does not overlap with the home code of other networks. And then broadcast the home code so that other home network modems also set the home code. Whether or not the home code is a duplicated home code is determined by sending a name request packet (S513). A handler for a response message of the name request message is registered in a table before sending the message (S512). This handler performs the routine S515 for the response message.

이름 요청 메시지를 방송하여 응답이 없으면(S514), 중복되지 않은 홈코드로 판단을 한다. 3회이상의 메시지에 대한 무응답시에 앞서 설명한 바와 같이 홈코드 설정 메시지를 송출한다(S56). 만약에 응답이 있다면, 그 홈코드는 중복 된 것이므로 홈코드 크리어(clear) 명령을 모뎀에 보내주어서(S515) 직전만든 홈코드를 지우고(S515) 다시 홈코드를 생성하도록 한다(S511). If there is no response by broadcasting the name request message (S514), it is determined that the home code is not duplicated. When no response to the three or more messages is sent, the home code setting message is transmitted as described above (S56). If there is a response, since the home code is a duplicate, a home code clear command is sent to the modem (S515) to clear the home code just before (S515) and generate a home code (S511).

홈코드 크리어를 위한 상기 라이브러리(110)의 루틴의 호출은 다음과 같이 이루어진다.The call of the routine of the library 110 for the home code cree is performed as follows.

int clear_home_code()int clear_home_code ()

이 루틴은, 마스터(master)와 연결된 홈 네트워크용 모뎀에 홈코드 클리어 명령 패킷을 전송함으로써 실제로 연결된 홈 네트워크용 모뎀에 설정된 홈코드가 제거되도록 한다.This routine sends the home code clear command packet to the home network modem connected to the master so that the home code set on the modem for the home network connected to the master is removed.

한편, 상기의 홈코드 생성/해제 과정은 중복되지 않은 홈코드가 만들어 질 때까지 반복된다. On the other hand, the home code generation / release process is repeated until the home code is not duplicated.

앞서 설명한 바와 같이, 최초로 네트워크를 설치하는 경우가 아니고, 새로운 기기를 기존의 네트워크에 추가하는 경우라면, 기존의 홈코드를 네트워크상에서 방송하여서 새로운 기기의 홈 네트워크용 모뎀에 홈코드를 설정하도록 한다(S56). As described above, when a new device is added to an existing network instead of the first network installation, the existing home code is broadcasted on the network to set the home code in the home network modem of the new device ( S56).

홈코드를 설정 할 때, 상기 라이브러리(110)가 임의로 생성한 홈코드가 아닌 사용자( 또는 네트워크 설치/운영자 )가 직접 정해주는 홈코드로 설정을 할 수도 있다. 이 때는 다음과 같은 함수를 상기 라이브러리(110)에 호출함으로써 홈코드를 수동적으로 설정할 수 있다.When setting a home code, the library 110 may be set to a home code directly set by a user (or a network installer / operator), not a home code randomly generated. In this case, the home code may be manually set by calling the following function to the library 110.

int push_home_code(unsigned long home_code);int push_home_code (unsigned long home_code);

상기 라이브러리(110)는 상기 함수가 호출되면 그 입력변수인 home_code의 값을 홈 네트워크를 통해 방송하여 각 기기(301,302)의 모뎀에 설정되도록 한다.When the function is called, the library 110 broadcasts the value of its input variable home_code through a home network to be set in the modems of the devices 301 and 302.

한편, 각각의 홈 네트워크 기기들은 각각의 주소를 가져야만 서로 통신을 할 수 있다. 상기 라이브러리(110)는, 이러한 주소를 설정하는데 필요한 루틴을 제공함으로써 상기 제어 어플리케이션(100)이 편리하게 어드레스를 할당하도록 해준다.On the other hand, each home network device must have its own address to communicate with each other. The library 110 provides the routine necessary to set this address so that the control application 100 can conveniently assign an address.

홈네트워크에 참여하려고 하는 기기는 어드레스를 할당 받기 위해서 Plug-In Notification 메시지를 방송(broadcasting)하며(S61), 이 Plug-In Notification을 받은 마스터의 라이브러리(110)는 그 메시지를 처리하여서 요청한 기기에게 주소를 할당하여 준다. The device attempting to join the home network broadcasts a Plug-In Notification message in order to receive an address (S61), and the master's library 110 receiving the Plug-In Notification processes the message and sends it to the requesting device. Assign an address.

이를 위해, 상기 라이브러리(110)는, 먼저 Plug-In Notification Handler를 자신의 Response function hash table 에 등록을 하여 Plug-In Notification 패킷이 들어오면 처리 할 수 있도록 한다. To this end, the library 110 first registers the Plug-In Notification Handler in its response function hash table so that the Plug-In Notification packet can be processed.

따라서, Plug-In Notification Packet을 받으면, Plug-In Notification Handler가 수행되며 핸들러는 그 packet을 보낸 기기의 유형(type)을 알아낸 다음 그 유형을 가지고 자신의 DB를 검색한다. DB를 검색하여 비어있는 주소를 확인한 다음(S62), 그 주소를 주소 변경(Address Change) 명령에 실어서 보내준다(S63). 이 과정은 다음의 함수호출에 의해 이루어진다.Therefore, when the Plug-In Notification Packet is received, the Plug-In Notification Handler is executed, and the handler finds the type of the device that sent the packet, and then searches its DB with the type. Search the DB to check the empty address (S62), and then send the address to the Address Change command (S63). This process is accomplished by calling the function

int change_address(old_addr, new_addr);int change_address (old_addr, new_addr);

change_address 함수의 입력 인자로는 홈 네트워크 기기의 기존 주소와 새로이 설정할 주소를 넣어 준다. 처음으로 홈네트워크에 참여하는 기기라면 old_addr은 디폴트(default) 주소( 예를 들어, 0 )가 될 것이다. 이 함수의 실행에 의해 주소 변경 명령이 홈 네트워크를 통해 전송된다.As an input parameter of the change_address function, an existing address of a home network device and an address to be newly set are input. If it is the first device joining the home network, old_addr will be the default address (for example, 0). The execution of this function sends an address change command over the home network.

이 함수루틴의 리턴시에는 주소 변경 작업의 성공 여부를 알려주는 값이 입력변수로 포함된다.When this function routine returns, a value indicating whether the address change operation was successful is included as an input variable.

한편, 상기 주소변경 명령을 받은 기기는 자신의 주소를, 명령에 들어있는 주소로 설정하고 응답을 보내게 된다. 상기 change_address루틴은 그 응답을 받으면 성공적으로 주소가 설정 된 것이므로, 자신의 DB에 그 할당된 주소를 저장하게 된다(S64). 아울러 다른 네트워크 관리자(Manager)에게 새로운 기기가 등록이 되었다는 사실을 알리기 위해서 DB 갱신(Update) 명령을 보내준다(S65). Meanwhile, the device receiving the address change command sets its own address as the address included in the command and sends a response. When the change_address routine receives the response, the change_address routine is successfully set, and thus stores the allocated address in its DB (S64). In addition, to update another network manager (Manager) that the new device has been registered to send a DB (Update) command (S65).

이런 작업을 한 후에 새로이 등록된( 즉, 주소를 할당받은 ) 기기에 대한 추가정보를 요청하여(S66,S67) 알아낸 후 DB에 기록해 둔다. 예를 들어, Device Search 명령을 보내서 그 기기가 Master인지 Slave인지를 알아내고(S66), Model Request 명령을 보내서 모델명을 알아낸다(S67).After doing this, additional information about newly registered device (ie, address assigned) is requested (S66, S67) to find out and recorded in DB. For example, the device search command is sent to find out whether the device is a master or slave (S66), and the model request is sent to find a model name (S67).

다음르로, 홈 네트워크를 사용함 에 있어서 마스터의 기능을 하는 장치가 처음 초기화 할 때, 홈 네트워크에 연결된 기기들의 옵션사항들을 설정하는 방법에 대해 상세히 설명한다. Next, the method for setting options of the devices connected to the home network at the time of initial initialization by the device functioning as the master in using the home network will be described in detail.                     

홈 네트워크에서 마스터의 기능을 하는 장치내의 라이브러리(110)는 각각 홈 네트워크 기기들의 존재 유무와 작동 여부를 확인해야 한다. 이 때 이를 위해 각각의 기기들에게 일정한 시간 간격으로 메시지를, 마스터 기기에게 보내어 자신이 정상 작동함을 알리게 하는 데, 이러한 메시지를 Alive 메시지라고 한다. 따라서, 마스터의 제어 어플리케이션(100)은 처음으로 수행됨으로써 네트워크를 초기화할 때, 이 시간 간격을 기기들에게 보내어 그 보낸 시간 간격으로 각 기기가 Alive 메시지를 보내는 지 상기 라이브러리(110)가 확인을 하여서 각 기기가 정상 작동하는 지를 확인할 수 있도록 한다. The library 110 in the device functioning as the master in the home network must check whether each home network device exists and whether or not it operates. To this end, each device sends a message to the master device at regular intervals to let it know that it is working. This message is called an Alive message. Therefore, when the master's control application 100 is performed for the first time and initializes the network, the library 110 checks whether each device sends an Alive message at the sent time interval by sending this time interval to the devices. Make sure that each device is working properly.

이를 위해서, 상기 제어 어플리케이션(100)은, 사용자( 또는 운영자 )로부터 입력되는 시간간격을 상기 라이브러리(110)의 해당 루틴을 다음과 같이 호출한다.For this purpose, the control application 100 calls the routine of the library 110 for the time interval input from the user (or operator) as follows.

int set_alive_message_interval (time);int set_alive_message_interval (time);

이 함수의 호출될 때, 상기 라이브러리(110)는 시간변수(time)을 입력 인자로 받아서 그 값을 홈 네트워크 각 디바이스에게 설정 메시지로 전달함으로써, 지정된 간격을 alive 메시지 전송주기로 설정하게 한다.When this function is called, the library 110 receives a time variable as an input argument and transmits the value as a configuration message to each device in the home network, thereby setting the designated interval as the alive message transmission period.

그리고, 홈 네트워크 기기들 중에서 현재시간 설정이 가능한 기기들에게는 시간을 설정 할 수 있는데, 이 를 설정하기 위해서 상기 제어 어플리케이션(100)은 상기 라이브러리(110)의 set_clock함수 루틴을 호출한다. 호출되는 set_clock 함수는 다음과 같이 정의된다.And, the time can be set for devices that can set the current time among the home network devices. To set this, the control application 100 calls the set_clock function routine of the library 110. The set_clock function to be called is defined as follows.

int set_clock (hour,min,sec);int set_clock (hour, min, sec);

이 함수의 호출시에, 상기 라이브러리(110)는 입력변수인 시, 분, 초의 값을 패킷으로 만들어 홈네트워크 해당 기기들에게 전송하고, 그 처리결과는 응답되는 메시지에 근거하여 리턴 값으로 상기 제어 어플리케이션(100)에게 전달한다.At the time of calling this function, the library 110 transmits the packet of the hour, minute, and second as input variables to the corresponding devices in the home network, and the result of the processing is controlled based on the returned message. Deliver to application 100.

그리고, 홈 네트워크 기기들은 기본적으로 자신의 상태변화를 이벤트를 통하여 다른 기기들과 마스터 기기들에게 알려주는데, 이런 이벤트들을 계속해서 보내게 할 것인지 아닌지를 상기 라이브러리(110)를 통해 설정할 수 있다. 이 옵션을 설정하기 위해서는 상기 제어 어플리케이션(100)는 상기 라이브러리(110)에 다음과 같은 함수루틴을 호출한다.In addition, the home network devices basically notify the other devices and the master devices of the change of their state through an event, and can set whether or not to continue sending these events through the library 110. To set this option, the control application 100 calls the following function routine in the library 110.

int event_enable(enable);int event_enable (enable);

이 함수의 호출시에, 상기 라이브러리(110)는 이벤트 전송의 활성화 여부를 입력변수로 받아서, 이 입력변수에 따른 명령을 만들어서 해당 기기에게 보내 주고 이 설정 값대로 이벤트 보고를 활성화할 것인지 아닌지를 설정하도록 한다. 그 설정에 따른 응답메시지가 수신되면 상기 라이브러리(110)는 그 응답메시지에 따른 리턴 값을 상기 제어 어플리케이션(100)에 전달한다.
When calling this function, the library 110 receives whether the event transmission is activated as an input variable, makes a command according to this input variable, sends it to the corresponding device, and sets whether or not to activate the event report according to this setting value. Do it. When the response message according to the setting is received, the library 110 transmits a return value according to the response message to the control application 100.

이상에서 상세히 설명한 본 발명에 따라, 제어 어플리케이션과 라이브러리간의 인터페이스 방법이 표준화됨으로 인해 제조업체간의 호환성이 확보되므로 사용자들은 홈 네트워크의 구축을 위한 기기들의 선택의 폭이 넓어지고 제조업체들은 구축된 기기들의 지원, 보수 또는 A/S 등을 위한 관리비용이 절감되는 효과가 있다.According to the present invention described in detail above, the compatibility between manufacturers is secured by standardizing the interface method between the control application and the library, so that users have a wider choice of devices for the construction of a home network, and manufacturers support the built-in devices. There is an effect of reducing the management cost for repair or after-sales service.

Claims (5)

홈 네트워크를 관리하는 기기내의 어플리케이션과 라이브러리간의 명령 및/또는 응답 방법에 있어서,In a command and / or response method between an application and a library in a device managing a home network, 상기 어플리케이션이 네트워크에 연결된 기기를 제어하기 위한 함수루틴을 상기 라이브러리에 호출하되, 제어할 기기의 식별정보와 제어를 위한 명령코드를 입력변수로 부가하여 호출하는 1단계; 및Calling, by the application, a function routine for controlling a device connected to a network to the library, and adding identification information of a device to be controlled and a command code for control as an input variable; And 상기 라이브러리가, 상기 명령코드에 의한 명령을 상기 기기의 식별정보에 의해 특정되는 기기에 대해 요청하고, 그 응답에 따른 결과값을 생성하여 상기 1단계의 호출에 대해 그 값을 리턴하는 2단계를 포함하여 이루어지는 방법.Step 2, wherein the library requests a command by the command code to the device specified by the identification information of the device, generates a result value according to the response, and returns the value for the call of step 1; Including method. 제 1항에 있어서,The method of claim 1, 상기 1단계에서, 상기 어플리케이션은 명령에 따른 결과를 대기할 것인지 아닌지를 알리는 명령옵션 정보를 상기 입력변수에 추가로 부가하는 것을 특징으로 하는 방법.In the step 1, the application further comprises a command option information to the input variable indicating whether or not to wait for the result according to the command. 제 1항에 있어서,The method of claim 1, 상기 라이브러리는, 상기 호출과 그 응답을 수행하기 위해, 상기 입력변수에 의한 정보와 상기 응답에 따른 정보를 저장하기 위한 명령 구조체를 구성하는 것을 특징으로 하는 방법.And the library constructs a command structure for storing information according to the input variable and information according to the response to carry out the call and its response. 제 3항에 있어서,The method of claim 3, wherein 상기 명령 구조체에는, 상기 기기의 식별정보와, 상기 명령코드와, 상기 입력변수의 스트링(string)과, 리턴할 정보와, 명령의 옵션이 저장될 공간이 할당되어 있는 것을 특징으로 하는 방법.And said command structure is assigned identification information of said device, said command code, a string of said input variable, information to return, and a space for storing options of the command. 제 4항에 있어서,The method of claim 4, wherein 상기 리턴할 정보는, 리턴할 문자열(string) 및/또는 메시지를 포함하는 것을 특징으로 하는 방법.The information to return comprises a string and / or a message to return.
KR1020040110729A 2004-12-22 2004-12-22 Interfacing method between application and library of a master on home network KR20060071753A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020040110729A KR20060071753A (en) 2004-12-22 2004-12-22 Interfacing method between application and library of a master on home network
US11/317,226 US20060230128A1 (en) 2004-12-22 2005-12-22 Method and apparatus interfacing for controlling a device between an application and a library of a master on home network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020040110729A KR20060071753A (en) 2004-12-22 2004-12-22 Interfacing method between application and library of a master on home network

Publications (1)

Publication Number Publication Date
KR20060071753A true KR20060071753A (en) 2006-06-27

Family

ID=37165138

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020040110729A KR20060071753A (en) 2004-12-22 2004-12-22 Interfacing method between application and library of a master on home network

Country Status (1)

Country Link
KR (1) KR20060071753A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102535011B1 (en) * 2022-10-14 2023-05-26 주식회사 플랜티넷 Method for Applying Network Device Settings Based on Microservice

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102535011B1 (en) * 2022-10-14 2023-05-26 주식회사 플랜티넷 Method for Applying Network Device Settings Based on Microservice

Similar Documents

Publication Publication Date Title
US20060230128A1 (en) Method and apparatus interfacing for controlling a device between an application and a library of a master on home network
CN100411352C (en) Home network system and method for operating the same
US20170242557A1 (en) Architecture for remote control of iot (internet of things) devices
US8019855B2 (en) Method and apparatus interfacing between an application and a library of a master for network managing
KR20050014628A (en) Home network system and its configuration system
WO2008014647A1 (en) A maintenance method for the capability management object, capability management method, the system and the terminal thereof
KR20070118602A (en) Network system management method
US20090160626A1 (en) Method for Setting Home Code in Network System and Device for Network
JP2016528621A (en) Related plug-in management method, apparatus and system
KR20040090600A (en) Home network device and system for a cooperative work service and method thereof
JP2005517311A (en) Home networking communication apparatus and method
US8484323B2 (en) Network system connected with multiple master devices and method for operating the same
CN111381508B (en) Control method, system and storage medium for smart home
WO2006083148A1 (en) Address management method and message transmitting and receiving method in network control system
CN104750544A (en) Process management system and process management method applied to distributed system
KR20030075728A (en) Method for confirming a home appliance connect state of home network system
EP2040418B1 (en) Program control method for network devices and network system
KR20060071753A (en) Interfacing method between application and library of a master on home network
WO2006004378A1 (en) Event interfacing method and apparatus between applications and a library of a master on home network
KR20060071746A (en) Interfacing method between application and library of a master on home network
KR20060071036A (en) Interfacing method between application and library of a master on home network
KR20070117585A (en) Method of configuring network profile of network system
KR20060071749A (en) Interfacing method between application and library of a master on home network
KR20060071751A (en) Interfacing method between application and library of a master on home network
KR20060071752A (en) Interfacing method between application and library of a master on home network

Legal Events

Date Code Title Description
WITN Application deemed withdrawn, e.g. because no request for examination was filed or no examination fee was paid