Multi-Generic Switch in Matter

Hi there,

I'm working on NCS 2.4.2 with 52840. Currently,I have tried using a single generic switch, and it works. However, I want to configure multiple generic switches.
But according to Matter Device Library v1.2 Chapter 6.6.4.2, a TagList SHALL be included in the Descriptor cluster on each such endpoint. 

My question is how to include TagList in Descriptor cluster?

Thanks
Ethan

Parents Reply Children
  • Hi Maria,

    Thanks for your replay. In this product,I need two generic switch.
    I've been used zap tool to add fixed label cluster in each generic switch endpoint and modified the hard-coded part in DeviceInfoProviderImpl.cpp like

    bool DeviceInfoProviderImpl::FixedLabelIteratorImpl::Next(FixedLabelType & output)
    {
        bool retval = true;
    
        // A hardcoded list for testing only
        CHIP_ERROR err = CHIP_NO_ERROR;
    
        const char * labelPtr = nullptr;
        const char * valuePtr = nullptr;
    
        VerifyOrReturnError(mIndex < 2, false);
    
        ChipLogProgress(DeviceLayer, "Get the fixed label with index:%u at endpoint:%d", static_cast<unsigned>(mIndex), mEndpoint);
    
    
        switch(mEndpoint)
        {
        case 0:
            printf("mIndex case 0\n");
            labelPtr = "room";
            valuePtr = "bedroom 2";
            break;
        case 1:
            printf("mIndex case 1\n");
            labelPtr = "orientation";
            valuePtr = "North";
            break;
        case 2:
            printf("mIndex case 2\n");
            labelPtr = "floor";
            valuePtr = "2";
            break;
        case 3:
            printf("mIndex case 3\n");
            labelPtr = "direction";
            valuePtr = "up";
            break;
        default:
            err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND;
            break;
        }
    
        if (err == CHIP_NO_ERROR)
        {
            VerifyOrReturnError(std::strlen(labelPtr) <= kMaxLabelNameLength, false);
            VerifyOrReturnError(std::strlen(valuePtr) <= kMaxLabelValueLength, false);
    
            Platform::CopyString(mFixedLabelNameBuf, kMaxLabelNameLength + 1, labelPtr);
            Platform::CopyString(mFixedLabelValueBuf, kMaxLabelValueLength + 1, valuePtr);
    
            output.label = CharSpan::fromCharString(mFixedLabelNameBuf);
            output.value = CharSpan::fromCharString(mFixedLabelValueBuf);
    
            mIndex++;
    
            retval = true;
        }
        else
        {
            retval = false;
        }
    
        return retval;
    }
    

    I utilized mEndpoint to assign distinct labels for different endpoints. However, upon pairing this device with HomeApp, I'm observing that only a single generic label is displayed.

    Any suggertion?

    Thanks~
    Ethan

  • By the way, there is another issue. I frequently encounter an error during device pairing with HomeApp.

    E: 83484 [DMG]Error retrieving data from clusterId: 0x0000_001D, err = b
    .....
    E: 83021 [DMG]Error retrieving data from clusterId: 0x0000_003E, err = b
    ......
    E: 55885 [DMG]Error retrieving data from clusterId: 0x0000_0028, err = b
    ..........

    I found that error "b" in CHIPError.h means " The attempt to allocate a buffer or object failed due to a lack of memory".  Although I have increased CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE, the issue still persists in every pairing attempt.

  • The err = b indicates that the current buffer for an outgoing ReportData buffer has run out. It is not serious, because the data will be sent in the next chunk.

    The devs are aware of the misleading message classification.

  • Hi Ethan,

    Thank you for your continued patience.

    I have asked the developers for some assistance on how the LabelList should be filled. When they reply I will share it with you.

    Best regards,

    Maria

  • Update from the developers:

    The hardcoded Fixed Label is implemented in the All Clusters Example Application.

    The Fixed Label cluster is not supported by all ecosystems. Google Home lists the unsupported features here.

    By using the chip-tool, you are able to test more features than with most commercial ecosystems. Make sure that the chip-tool version installed is from your NCS version (v2.4.2). See this documentation for installation and use.

    Best regards,

    Maria

Related