YOGYUI

Matter - Device Type 본문

홈네트워크(IoT)/Matter

Matter - Device Type

요겨 2023. 4. 17. 11:28
반응형

Matter :: Device Type

MatterEndpoint(엔드포인트)들은 개별적으로 최소 하나 이상의 Device Type들을 가지게 되며, 해당 디바이스 타입을 지원하는 Cluster(클러스터)들의 조합으로 구성된다

매터 에코시스템에서는 Device Type ID를 통해 해당 디바이스가 어떤 종류의 기기인지를 판단하고 그에 맞는 제어 인터페이스를 제공하게 되므로, 개발자가 만들고자 하는 제품 유형에 맞는 Device ID를 커미셔닝 시 사용할 수 있도록 구현하는 것이 중요하다 (물론 API로 잘 되어있다)

 

다음은 Endpoint에 대한 Matter Specification 1.0 문서 원문이다

[Endpoint]
A node is composed of one or more endpoints. An endpoint is an instance of something that could be a service or virtual device as indicated by a device type.
Each endpoint conforms to one or more device type definitions that define the clusters supported on the endpoint. Clusters are object classes that are instantiated on an endpoint.
The word 'device', depending on the context, may be used as shorthand to denote the device type definition as represented by a device type ID, a device type implementation, or an endpoint (device type instance).
There are also many examples in specification text where 'device' is used, when it would be better, and more accurate to use 'node', 'physical device', or 'product'.
The word 'device' may also be used in cluster specifications to describe application software that is supporting an instance of a cluster server or client. In this case, it would be better, and more accurate to use either 'client' or 'server'.
One must be careful to make sure there is no ambiguity when using the word 'device' in specification text, or better yet, use another word.

Matter (ConnectedHomeIP) 소스코드에서 Device Type ID는 16비트 정수형으로 구성되어 있다

// connectedhomeip/src/app/util/af-types.h
typedef struct
{
    uint16_t deviceId;
    uint8_t deviceVersion;
} EmberAfDeviceType;

해당 구조체는 Dynamic Endpoint 추가 시 다음과 같이 활용된다

(chip::Span으로 1개 이상의 device type을 추가하는 것을 알 수 있다)

// connectedhomeip/src/app/util/attribute-storage.cpp
EmberAfDefinedEndpoint emAfEndpoints[MAX_ENDPOINT_COUNT];

EmberAfStatus emberAfSetDynamicEndpoint(
    uint16_t index, EndpointId id, const EmberAfEndpointType * ep,
    const chip::Span<chip::DataVersion> & dataVersionStorage,
    chip::Span<const EmberAfDeviceType> deviceTypeList, EndpointId parentEndpointId)
{
    /* 중략 */
    emAfEndpoints[index].endpoint       = id;
    emAfEndpoints[index].deviceTypeList = deviceTypeList;
    emAfEndpoints[index].endpointType   = ep;
    emAfEndpoints[index].dataVersions   = dataVersionStorage.data();
    /* 중략 */
}

EmberAfDefinedEndpoint 구조체의 원형은 다음과 같다

※ CSA의 전신이 Zigbee Aliance이고, Matter 코드 자체가 Zigbee 데이터모델을 거의 그대로 차용한 것이다보니 군데군데 'zigbee' 단어가 주석으로 많이 남아있는 것을 알 수 있다 ㅎㅎ

// connectedhomeip/src/app/util/af-types.h
struct EmberAfDefinedEndpoint
{
    /**
     * Actual zigbee endpoint number.
     */
    chip::EndpointId endpoint = chip::kInvalidEndpointId;

    /**
     * Span pointing to a list of supported device types
     */
    chip::Span<const EmberAfDeviceType> deviceTypeList;

    /**
     * Meta-data about the endpoint
     */
    EmberAfEndpointBitmask bitmask = EMBER_AF_ENDPOINT_DISABLED;
    /**
     * Endpoint type for this endpoint.
     */
    const EmberAfEndpointType * endpointType = nullptr;
    /**
     * Pointer to the DataVersion storage for the server clusters on this
     * endpoint
     */
    chip::DataVersion * dataVersions = nullptr;

    /**
     * Root endpoint id for composed device type.
     */
    chip::EndpointId parentEndpointId = chip::kInvalidEndpointId;
};

다음은 다양한 유형의 Device Type들의 ID List를 테이블

- Matter 1.0 스펙 기반이며, 앞으로 계속 추가되어 나갈 예정

Category Device Name Device ID
Utility Root Node 0x0016
Power Source 0x0011
OTA Requestor 0x0012
OTA Provider 0x0014
Aggregator 0x000E
Bridged Node 0x0013
Lighting On/Off Light 0x0100
Dimmable Light 0x0101
Color Temperature Light 0x010C
Extended Color Light 0x010D
Smart Plugs/Outlets
other Actuators
On/Off Plug-In Unit 0x010A
Dimmable Plug-In Unit 0x010B
Pump 0x0303
Switches and Controls On/Off Light Switch 0x0103
Dimmer Switch 0x0104
Color Dimmer Switch 0x0105
Control Bridge 0x0840
Pump Controller 0x0304
Generic Switch 0x000F
Sensors Contact Sensor 0x0015
Light Sensor 0x0106
Occupancy Sensor 0x0107
Temperature Sensor 0x0302
Pressure Sensor 0x0305
Flow Sensor 0x0306
Humidity Sensor 0x0307
On/Off Sensor 0x0850
Closures Door Lock 0x000A
Door Lock Controller 0x000B
Window Covering 0x0202
Window Covering Controller 0x0203
HVAC Heating/Cooling Unit 0x0300
Thermostat 0x0301
Fan 0x002B
Media Basic Video Player 0x0028
Casting Video Player 0x0023
Speaker 0x0022
Content App 0x0024
Casting Video Client 0x0029
Video Remote Control 0x002A
Generic Mode Select 0x0027

 

반응형
Comments