Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mobile-device-test.py endpoint to 0 instead of 1 and use const… #6531

Merged
merged 2 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
} // namespace chip

void emberAfPostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
chip::DeviceManager::CHIPDeviceManagerCallbacks * cb =
chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks();
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
}

void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
ESP_LOGI(TAG, "PostAttributeChangeCallback - Cluster ID: '0x%04x', EndPoint ID: '0x%02x', Attribute ID: '0x%04x'", clusterId,
endpointId, attributeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class DLL_EXPORT CHIPDeviceManagerCallbacks
* @param value pointer to the new value
*/
virtual void PostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{}
virtual ~CHIPDeviceManagerCallbacks() {}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks
public:
virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
virtual void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value);
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value);

private:
void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event);
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ using namespace chip::Transport;
using namespace chip::DeviceLayer;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{}

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj)
Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ using namespace chip::Transport;
using namespace chip::DeviceLayer;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
if (clusterId != ZCL_ON_OFF_CLUSTER_ID)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/efr32/src/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
using namespace ::chip;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
if (clusterId != ZCL_ON_OFF_CLUSTER_ID)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/k32w/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using namespace ::chip;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
if (clusterId != ZCL_ON_OFF_CLUSTER_ID)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ using namespace chip;
using namespace chip::DeviceLayer;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
if (clusterId != ZCL_ON_OFF_CLUSTER_ID)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void LightingManager::SetCallbacks(LightingCallback_fn aActionInitiated_CB, Ligh
mActionCompleted_CB = aActionCompleted_CB;
}

bool LightingManager::InitiateAction(Action_t aAction, int32_t aActor, uint8_t size, uint8_t * value)
bool LightingManager::InitiateAction(Action_t aAction, int32_t aActor, uint16_t size, uint8_t * value)
{
// TODO: this function is called InitiateAction because we want to implement some features such as ramping up here.
bool action_initiated = false;
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/nrfconnect/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
using namespace chip;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
ChipLogProgress(Zcl, "Cluster callback: %d", clusterId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class LightingManager
int Init(const device * pwmDevice, uint32_t pwmChannel);
bool IsTurnedOn() const { return mState == kState_On; }
uint8_t GetLevel() const { return mLevel; }
bool InitiateAction(Action_t aAction, int32_t aActor, uint8_t size, uint8_t * value);
bool InitiateAction(Action_t aAction, int32_t aActor, uint16_t size, uint8_t * value);
void SetCallbacks(LightingCallback_fn aActionInitiated_CB, LightingCallback_fn aActionCompleted_CB);

private:
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/qpg6100/include/LightingManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LightingManager
int Init();
bool IsTurnedOn();
uint8_t GetLevel();
bool InitiateAction(Action_t aAction, int32_t aActor, uint8_t size, uint8_t * value);
bool InitiateAction(Action_t aAction, int32_t aActor, uint16_t size, uint8_t * value);

using LightingCallback_fn = std::function<void(Action_t)>;

Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/qpg6100/src/LightingManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void LightingManager::SetCallbacks(LightingCallback_fn aActionInitiated_CB, Ligh
mActionCompleted_CB = aActionCompleted_CB;
}

bool LightingManager::InitiateAction(Action_t aAction, int32_t aActor, uint8_t size, uint8_t * value)
bool LightingManager::InitiateAction(Action_t aAction, int32_t aActor, uint16_t size, uint8_t * value)
{
// TODO: this function is called InitiateAction because we want to implement some features such as ramping up here.
bool action_initiated = false;
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/qpg6100/src/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
using namespace ::chip;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
if (clusterId == ZCL_ON_OFF_CLUSTER_ID)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
using namespace ::chip;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
if (clusterId != ZCL_ON_OFF_CLUSTER_ID)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/esp32/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
} // namespace chip

void emberAfPostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
chip::DeviceManager::CHIPDeviceManagerCallbacks * cb =
chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks();
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
ESP_LOGI(TAG, "Current free heap: %d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT));
}
void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
ESP_LOGI(TAG, "PostAttributeChangeCallback - Cluster ID: '0x%04x', EndPoint ID: '0x%02x', Attribute ID: '0x%04x'", clusterId,
endpointId, attributeId);
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/esp32/main/include/CHIPDeviceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class DLL_EXPORT CHIPDeviceManagerCallbacks
* @param value pointer to the new value
*/
virtual void PostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{}
virtual ~CHIPDeviceManagerCallbacks() {}
};
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/esp32/main/include/DeviceCallbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks
public:
virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
virtual void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value);
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value);

private:
void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event);
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/k32w/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using namespace ::chip;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
if (clusterId != ZCL_ON_OFF_CLUSTER_ID)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/nrfconnect/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
using namespace ::chip;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
if (clusterId != ZCL_ON_OFF_CLUSTER_ID)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/qpg6100/src/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
using namespace ::chip;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
if (clusterId != ZCL_ON_OFF_CLUSTER_ID)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
} // namespace chip

void emberAfPostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
chip::DeviceManager::CHIPDeviceManagerCallbacks * cb =
chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
}

void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
ESP_LOGI(TAG, "PostAttributeChangeCallback - Cluster ID: '0x%04x', EndPoint ID: '0x%02x', Attribute ID: '0x%04x'", clusterId,
endpointId, attributeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class DLL_EXPORT CHIPDeviceManagerCallbacks
* @param value pointer to the new value
*/
virtual void PostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{}
virtual ~CHIPDeviceManagerCallbacks() {}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks
public:
virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
virtual void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId,
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value);
uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value);

private:
void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event);
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/linux/include/cluster-change-attribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void runTvCommand(TvCommand command)
}

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
if (clusterId == ZCL_ON_OFF_CLUSTER_ID && attributeId == ZCL_ON_OFF_ATTRIBUTE_ID)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/window-app/efr32/src/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
using namespace ::chip;

void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask,
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value)
{
if (clusterId != ZCL_WINDOW_COVERING_CLUSTER_ID)
{
Expand Down
11 changes: 7 additions & 4 deletions src/controller/python/test/mobile-device-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
# Network id, for the thread network, current a const value, will be changed to XPANID of the thread network.
TEST_THREAD_NETWORK_ID = "fedcba9876543210"

ENDPOINT_ID = 0
GROUP_ID = 0


def TestFail(message):
logger.fatal("Testfail: {}".format(message))
Expand Down Expand Up @@ -86,7 +89,7 @@ def TestKeyExchange(self, ip: str, setuppin: int, nodeid: int):
def TestNetworkCommissioning(self, nodeid: int):
self.logger.info("Commissioning network to device {}".format(nodeid))
try:
self.devCtrl.ZCLSend("NetworkCommissioning", "AddThreadNetwork", nodeid, 1, 0, {
self.devCtrl.ZCLSend("NetworkCommissioning", "AddThreadNetwork", nodeid, ENDPOINT_ID, GROUP_ID, {
"operationalDataset": bytes.fromhex(TEST_THREAD_NETWORK_DATASET_TLV),
"breadcrumb": 0,
"timeoutMs": 1000})
Expand All @@ -95,7 +98,7 @@ def TestNetworkCommissioning(self, nodeid: int):
return False
self.logger.info("Send EnableNetwork command to device {}".format(nodeid))
try:
self.devCtrl.ZCLSend("NetworkCommissioning", "EnableNetwork", nodeid, 1, 0, {
self.devCtrl.ZCLSend("NetworkCommissioning", "EnableNetwork", nodeid, ENDPOINT_ID, GROUP_ID, {
"networkID": bytes.fromhex(TEST_THREAD_NETWORK_ID),
"breadcrumb": 0,
"timeoutMs": 1000})
Expand All @@ -107,12 +110,12 @@ def TestNetworkCommissioning(self, nodeid: int):
def TestOnOffCluster(self, nodeid: int):
self.logger.info("Sending On/Off commands to device {}".format(nodeid))
try:
self.devCtrl.ZCLSend("OnOff", "On", nodeid, 1, 0, {})
self.devCtrl.ZCLSend("OnOff", "On", nodeid, ENDPOINT_ID, GROUP_ID, {})
except Exception as ex:
self.logger.exception("Failed to send On command")
return False
try:
self.devCtrl.ZCLSend("OnOff", "Off", nodeid, 1, 0, {})
self.devCtrl.ZCLSend("OnOff", "Off", nodeid, ENDPOINT_ID, GROUP_ID, {})
except Exception as ex:
self.logger.exception("Failed to send Off command")
return False
Expand Down