-
Notifications
You must be signed in to change notification settings - Fork 148
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
I can't create a Window Covering device with a custom end_product_type (CON-363) #280
Comments
Can we set the const value when we create the config?
|
@wqx6 I tried something similar, and to ensure that wasn't a problem from
But didn't work, the build resulted on this error:
|
This is not possible because we have a default constructor for |
Would it be possible for you to try the attached move_inits_to_struct_itself.txt? And in application please use
|
The patch couldn't be applied over the last commit (80a22dc), but I tried to do a merge with the following result: namespace window_covering {
typedef struct config {
uint16_t cluster_revision = 5;
uint8_t type = 0;
uint8_t config_status;
uint8_t operational_status = 0;
const uint8_t end_product_type = 0;
uint8_t mode = 0;
feature::lift::config_t lift;
config (uint8_t end_product_type = 0)
{
this->end_product_type = end_product_type;
}
} config_t;
...
} I keept the
|
@Diegorro98 Sorry for the late turnaround. I got the problem here, you are creating the device type and it adds the window covering cluster and since it is making a cluster config object, you won't be able to configure any const that are defined inside that cluster. If we remove const then it sort of breaks the specification. In specification, quality of end_product_type is fixed, so it shall not change once configured. If we remove const it breaks the spec. Will check what can be done. |
@shubhamdp I finally found a way to keep namespace window_covering {
typedef struct config {
uint16_t cluster_revision;
uint8_t type;
uint8_t config_status;
uint8_t operational_status;
const uint8_t end_product_type;
uint8_t mode;
feature::lift::config_t lift;
config(uint8_t end_product_type = 0) : cluster_revision(5), type(0), config_status(0), operational_status(0), end_product_type(end_product_type), mode(0) {}
} config_t;
cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_t features);
} /* window_covering */ This works, it lets me create an instance of So what I did is create a constructor also for namespace window_covering {
typedef struct config {
cluster::identify::config_t identify;
cluster::groups::config_t groups;
cluster::scenes::config_t scenes;
cluster::window_covering::config_t window_covering;
config(uint8_t end_product_type = 0) : window_covering(end_product_type) {}
} config_t;
...
} /* window_covering */ This way I can create a window covering device config with a custom end_product_type: window_covering_device::config_t wcd_config(static_cast<uint8_t>(chip::app::Clusters::WindowCovering::EndProductType::kTiltOnlyInteriorBlind)); If you are ok with this solution, I can create a PR with this change and also for |
@Diegorro98 Once you set the const through the constructor, remaining non-const members can be set to other values by |
To create a Window Covering device with a custom
end_product_type
I used the following code:Now I can't create a window covering device which has a different
end_product_type
value than 0 because now it is declared asconst
in this line:esp-matter/components/esp_matter/esp_matter_cluster.h
Line 325 in 3484600
Is this expected? Then how do we specify what type of end product is?
In commit 3484600 message, there is a mention that says "sync with spec", there is an unreleased matter spec where
end_product_type
can't be different than 0? or maybe there is another way to modify it...?The text was updated successfully, but these errors were encountered: