#include "gen/CHIPClientCallbacks.h"
#include <controller/CHIPClusters.h>
#include <lib/core/CHIPSafeCasts.h>
-#include <lib/support/Span.h>
static void OnDefaultSuccessResponse(void * context)
{
command->SetCommandExitStatus(false);
}
-typedef void (*UnsupportedAttributeCallback)(void * context);
-static void OnUnsupportedAttributeResponse(void * context)
-{
- ChipLogError(chipTool, "Unsupported attribute Response. This should never happen !");
-}
-
static void OnBooleanAttributeResponse(void * context, bool value)
{
ChipLogProgress(chipTool, "Boolean attribute Response: %d", value);
command->SetCommandExitStatus(true);
}
-static void OnInt16sAttributeResponse(void * context, int16_t value)
+static void OnInt32uAttributeResponse(void * context, uint32_t value)
{
- ChipLogProgress(chipTool, "Int16s attribute Response: %" PRId16, value);
+ ChipLogProgress(chipTool, "Int32u attribute Response: %" PRIu32, value);
ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
command->SetCommandExitStatus(true);
command->SetCommandExitStatus(true);
}
+static void OnInt16sAttributeResponse(void * context, int16_t value)
+{
+ ChipLogProgress(chipTool, "Int16s attribute Response: %" PRId16, value);
+
+ ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
+ command->SetCommandExitStatus(true);
+}
+
+static void OnStringAttributeResponse(void * context, const chip::ByteSpan value)
+{
+ char * str = (char *) malloc(value.size() * sizeof(char));
+ memmove(str, value.data(), value.size());
+ str[value.size()] = '\0';
+ free(str);
+
+ ChipLogProgress(chipTool, "String attribute Response: %s (%" PRIu16 ")", str, strlen(str));
+
+ ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
+ command->SetCommandExitStatus(true);
+}
+
static void OnContentLaunchClusterLaunchContentResponse(void * context, uint8_t contentLaunchStatus)
{
ChipLogProgress(chipTool, "ContentLaunchClusterLaunchContentResponse");
|---------------------------------------------------------------------+--------|
| ApplicationBasic | 0x050D |
| BarrierControl | 0x0103 |
-| Basic | 0x0000 |
+| Basic | 0x0028 |
| Binding | 0xF000 |
| ColorControl | 0x0300 |
| ContentLaunch | 0xF002 |
constexpr chip::ClusterId kApplicationBasicClusterId = 0x050D;
constexpr chip::ClusterId kBarrierControlClusterId = 0x0103;
-constexpr chip::ClusterId kBasicClusterId = 0x0000;
+constexpr chip::ClusterId kBasicClusterId = 0x0028;
constexpr chip::ClusterId kBindingClusterId = 0xF000;
constexpr chip::ClusterId kColorControlClusterId = 0x0300;
constexpr chip::ClusterId kContentLaunchClusterId = 0xF002;
}
private:
- chip::Callback::Callback<UnsupportedAttributeCallback> * onSuccessCallback =
- new chip::Callback::Callback<UnsupportedAttributeCallback>(OnUnsupportedAttributeResponse, this);
+ chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
}
private:
- chip::Callback::Callback<UnsupportedAttributeCallback> * onSuccessCallback =
- new chip::Callback::Callback<UnsupportedAttributeCallback>(OnUnsupportedAttributeResponse, this);
+ chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
}
private:
- chip::Callback::Callback<UnsupportedAttributeCallback> * onSuccessCallback =
- new chip::Callback::Callback<UnsupportedAttributeCallback>(OnUnsupportedAttributeResponse, this);
+ chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
};
/*----------------------------------------------------------------------------*\
-| Cluster Basic | 0x0000 |
+| Cluster Basic | 0x0028 |
|------------------------------------------------------------------------------|
| Commands: | |
| * MfgSpecificPing | 0x00 |
-| * ResetToFactoryDefaults | 0x00 |
|------------------------------------------------------------------------------|
| Attributes: | |
-| * ZclVersion | 0x0000 |
-| * PowerSource | 0x0007 |
+| * InteractionModelVersion | 0x0000 |
+| * VendorName | 0x0001 |
+| * VendorID | 0x0002 |
+| * ProductName | 0x0003 |
+| * ProductID | 0x0004 |
+| * UserLabel | 0x0005 |
+| * Location | 0x0006 |
+| * HardwareVersion | 0x0007 |
+| * HardwareVersionString | 0x0008 |
+| * SoftwareVersion | 0x0009 |
+| * SoftwareVersionString | 0x000A |
| * ClusterRevision | 0xFFFD |
\*----------------------------------------------------------------------------*/
CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
- ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x00) on endpoint %" PRIu16, endpointId);
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
chip::Controller::BasicCluster cluster;
cluster.Associate(device, endpointId);
};
/*
- * Command ResetToFactoryDefaults
+ * Discover Attributes
*/
-class BasicResetToFactoryDefaults : public ModelCommand
+class DiscoverBasicAttributes : public ModelCommand
{
public:
- BasicResetToFactoryDefaults() : ModelCommand("reset-to-factory-defaults") { ModelCommand::AddArguments(); }
+ DiscoverBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
- ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x00) on endpoint %" PRIu16, endpointId);
+ ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
chip::Controller::BasicCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.ResetToFactoryDefaults(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
}
private:
};
/*
- * Discover Attributes
+ * Attribute InteractionModelVersion
*/
-class DiscoverBasicAttributes : public ModelCommand
+class ReadBasicInteractionModelVersion : public ModelCommand
{
public:
- DiscoverBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
+ ReadBasicInteractionModelVersion() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "interaction-model-version");
+ ModelCommand::AddArguments();
+ }
CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
- ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
chip::Controller::BasicCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ return cluster.ReadAttributeInteractionModelVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute VendorName
+ */
+class ReadBasicVendorName : public ModelCommand
+{
+public:
+ ReadBasicVendorName() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "vendor-name");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeVendorName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute VendorID
+ */
+class ReadBasicVendorID : public ModelCommand
+{
+public:
+ ReadBasicVendorID() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "vendor-id");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeVendorID(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute ProductName
+ */
+class ReadBasicProductName : public ModelCommand
+{
+public:
+ ReadBasicProductName() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "product-name");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeProductName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute ProductID
+ */
+class ReadBasicProductID : public ModelCommand
+{
+public:
+ ReadBasicProductID() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "product-id");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeProductID(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute UserLabel
+ */
+class ReadBasicUserLabel : public ModelCommand
+{
+public:
+ ReadBasicUserLabel() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "user-label");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+};
+
+class WriteBasicUserLabel : public ModelCommand
+{
+public:
+ WriteBasicUserLabel() : ModelCommand("write")
+ {
+ AddArgument("attr-name", "user-label");
+ AddArgument("attr-value", &mValue);
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.WriteAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
+ chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
}
private:
new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+ char * mValue;
};
/*
- * Attribute ZclVersion
+ * Attribute Location
*/
-class ReadBasicZclVersion : public ModelCommand
+class ReadBasicLocation : public ModelCommand
{
public:
- ReadBasicZclVersion() : ModelCommand("read")
+ ReadBasicLocation() : ModelCommand("read")
{
- AddArgument("attr-name", "zcl-version");
+ AddArgument("attr-name", "location");
ModelCommand::AddArguments();
}
CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
- ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x00) on endpoint %" PRIu16, endpointId);
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
chip::Controller::BasicCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.ReadAttributeZclVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ return cluster.ReadAttributeLocation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
}
private:
- chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
- new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
+ chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
+class WriteBasicLocation : public ModelCommand
+{
+public:
+ WriteBasicLocation() : ModelCommand("write")
+ {
+ AddArgument("attr-name", "location");
+ AddArgument("attr-value", &mValue);
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.WriteAttributeLocation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
+ chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
+ }
+
+private:
+ chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
+ new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+ char * mValue;
+};
+
/*
- * Attribute PowerSource
+ * Attribute HardwareVersion
*/
-class ReadBasicPowerSource : public ModelCommand
+class ReadBasicHardwareVersion : public ModelCommand
{
public:
- ReadBasicPowerSource() : ModelCommand("read")
+ ReadBasicHardwareVersion() : ModelCommand("read")
{
- AddArgument("attr-name", "power-source");
+ AddArgument("attr-name", "hardware-version");
ModelCommand::AddArguments();
}
CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
- ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x00) on endpoint %" PRIu16, endpointId);
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
chip::Controller::BasicCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.ReadAttributePowerSource(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ return cluster.ReadAttributeHardwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
}
private:
- chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
- new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
+ chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute HardwareVersionString
+ */
+class ReadBasicHardwareVersionString : public ModelCommand
+{
+public:
+ ReadBasicHardwareVersionString() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "hardware-version-string");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeHardwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute SoftwareVersion
+ */
+class ReadBasicSoftwareVersion : public ModelCommand
+{
+public:
+ ReadBasicSoftwareVersion() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "software-version");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeSoftwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute SoftwareVersionString
+ */
+class ReadBasicSoftwareVersionString : public ModelCommand
+{
+public:
+ ReadBasicSoftwareVersionString() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "software-version-string");
+ ModelCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::BasicCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeSoftwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
{
- ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x00) on endpoint %" PRIu16, endpointId);
+ ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
chip::Controller::BasicCluster cluster;
cluster.Associate(device, endpointId);
}
private:
- chip::Callback::Callback<UnsupportedAttributeCallback> * onSuccessCallback =
- new chip::Callback::Callback<UnsupportedAttributeCallback>(OnUnsupportedAttributeResponse, this);
+ chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
chip::Controller::DoorLockCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.LockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mPin);
+ return cluster.LockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
+ chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
}
private:
chip::Controller::DoorLockCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.SetPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType, mPin);
+ return cluster.SetPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType,
+ chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
}
private:
chip::Controller::DoorLockCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.SetRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType, mId);
+ return cluster.SetRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType,
+ chip::ByteSpan(chip::Uint8::from_char(mId), strlen(mId)));
}
private:
chip::Controller::DoorLockCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.UnlockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mPin);
+ return cluster.UnlockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
+ chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
}
private:
chip::Controller::DoorLockCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.UnlockWithTimeout(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTimeoutInSeconds, mPin);
+ return cluster.UnlockWithTimeout(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTimeoutInSeconds,
+ chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
}
private:
}
private:
- chip::Callback::Callback<UnsupportedAttributeCallback> * onSuccessCallback =
- new chip::Callback::Callback<UnsupportedAttributeCallback>(OnUnsupportedAttributeResponse, this);
+ chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};
chip::Controller::GroupsCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.AddGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mGroupName);
+ return cluster.AddGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId,
+ chip::ByteSpan(chip::Uint8::from_char(mGroupName), strlen(mGroupName)));
}
private:
chip::Controller::GroupsCluster cluster;
cluster.Associate(device, endpointId);
- return cluster.AddGroupIfIdentifying(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mGroupName);
+ return cluster.AddGroupIfIdentifying(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId,
+ chip::ByteSpan(chip::Uint8::from_char(mGroupName), strlen(mGroupName)));
}
private:
chip::Controller::ScenesCluster cluster;
cluster.Associate(device, endpointId);
return cluster.AddScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId, mTransitionTime,
- mSceneName, mClusterId, mLength, mValue);
+ chip::ByteSpan(chip::Uint8::from_char(mSceneName), strlen(mSceneName)), mClusterId, mLength,
+ mValue);
}
private:
const char * clusterName = "Basic";
commands_list clusterCommands = {
- make_unique<BasicMfgSpecificPing>(), make_unique<BasicResetToFactoryDefaults>(), make_unique<DiscoverBasicAttributes>(),
- make_unique<ReadBasicZclVersion>(), make_unique<ReadBasicPowerSource>(), make_unique<ReadBasicClusterRevision>(),
+ make_unique<BasicMfgSpecificPing>(),
+ make_unique<DiscoverBasicAttributes>(),
+ make_unique<ReadBasicInteractionModelVersion>(),
+ make_unique<ReadBasicVendorName>(),
+ make_unique<ReadBasicVendorID>(),
+ make_unique<ReadBasicProductName>(),
+ make_unique<ReadBasicProductID>(),
+ make_unique<ReadBasicUserLabel>(),
+ make_unique<WriteBasicUserLabel>(),
+ make_unique<ReadBasicLocation>(),
+ make_unique<WriteBasicLocation>(),
+ make_unique<ReadBasicHardwareVersion>(),
+ make_unique<ReadBasicHardwareVersionString>(),
+ make_unique<ReadBasicSoftwareVersion>(),
+ make_unique<ReadBasicSoftwareVersionString>(),
+ make_unique<ReadBasicClusterRevision>(),
};
commands.Register(clusterName, clusterCommands);