Berry Zigbee removed test code (#22263)

This commit is contained in:
s-hadinger 2024-10-10 19:50:57 +02:00 committed by GitHub
parent db47b92bc1
commit cc6ec3648f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 45 additions and 44 deletions

View File

@ -28,6 +28,7 @@ All notable changes to this project will be documented in this file.
- ESP32 Ethernet using EthClockMode 3 (#22248) - ESP32 Ethernet using EthClockMode 3 (#22248)
### Removed ### Removed
- Berry Zigbee removed test code
## [14.2.0.5] 20240926 ## [14.2.0.5] 20240926
### Added ### Added

View File

@ -127,8 +127,8 @@ class be_class_zb_coord_ntv (scope: global, name: zb_coord_ntv, strings: weak) {
abort, ctype_func(zc_abort) abort, ctype_func(zc_abort)
test_attr, func(zigbee_test_attr) // test_attr, func(zigbee_test_attr)
test_msg, func(zigbee_test_msg) // test_msg, func(zigbee_test_msg)
} }
@const_object_info_end */ @const_object_info_end */

View File

@ -601,38 +601,38 @@ extern "C" {
} }
extern "C" { extern "C" {
int zigbee_test_attr(struct bvm *vm) { // int zigbee_test_attr(struct bvm *vm) {
int32_t mode = be_toint(vm, 2); // int32_t mode = be_toint(vm, 2);
if (mode < 10) { // if (mode < 10) {
// // //
} else { // } else {
Z_attribute *a = new Z_attribute(); // Z_attribute *a = new Z_attribute();
if (mode == 10) { // if (mode == 10) {
a->setKeyId(1111, 2222); // a->setKeyId(1111, 2222);
a->setUInt(1337); // a->setUInt(1337);
} else if (mode == 11) { // } else if (mode == 11) {
a->setKeyName("super_attribute"); // a->setKeyName("super_attribute");
a->key_suffix = 2; // a->key_suffix = 2;
a->setFloat(3.14); // a->setFloat(3.14);
} else if (mode == 12) { // } else if (mode == 12) {
a->setKeyName("array"); // a->setKeyName("array");
a->newJsonArray(); // a->newJsonArray();
a->val.arrval->add((int32_t)-1); // a->val.arrval->add((int32_t)-1);
a->val.arrval->addStr("foo"); // a->val.arrval->addStr("foo");
a->val.arrval->addStr("bar"); // a->val.arrval->addStr("bar");
a->val.arrval->addStr("bar\"baz\'toto"); // a->val.arrval->addStr("bar\"baz\'toto");
} else if (mode == 13) { // } else if (mode == 13) {
a->setKeyName("list"); // a->setKeyName("list");
a->newAttrList(); // a->newAttrList();
Z_attribute &subattr1 = a->val.objval->addAttribute(10,20); // Z_attribute &subattr1 = a->val.objval->addAttribute(10,20);
subattr1.setStr("sub1"); // subattr1.setStr("sub1");
Z_attribute &subattr2 = a->val.objval->addAttribute(11,21); // Z_attribute &subattr2 = a->val.objval->addAttribute(11,21);
subattr2.setStr("sub2"); // subattr2.setStr("sub2");
} // }
zat_zcl_attribute(vm, a); // zat_zcl_attribute(vm, a);
} // }
be_return(vm); // be_return(vm);
} // }
// Creates a zcl_attributes from Z_attribute_list // Creates a zcl_attributes from Z_attribute_list
@ -651,18 +651,18 @@ extern "C" {
} }
} }
int zigbee_test_msg(struct bvm *vm) { // int zigbee_test_msg(struct bvm *vm) {
Z_attribute_list attr_list; // Z_attribute_list attr_list;
attr_list.lqi = 250; // attr_list.lqi = 250;
Z_attribute &subattr1 = attr_list.addAttribute(10,20); // Z_attribute &subattr1 = attr_list.addAttribute(10,20);
subattr1.setStr("sub1"); // subattr1.setStr("sub1");
Z_attribute &subattr2 = attr_list.addAttribute(11,21); // Z_attribute &subattr2 = attr_list.addAttribute(11,21);
subattr2.setStr("sub2"); // subattr2.setStr("sub2");
zat_zcl_attribute_list(vm, 100, &attr_list); // zat_zcl_attribute_list(vm, 100, &attr_list);
be_return(vm); // be_return(vm);
} // }
} }
#endif // USE_ZIGBEE #endif // USE_ZIGBEE