Open erjiaqing opened 1 year ago
We have lots of APIs looks like:
PyChipError pychip_OpCreds_AllocateController(OpCredsContext * context, chip::Controller::DeviceCommissioner ** outDevCtrl, FabricId fabricId, chip::NodeId nodeId, chip::VendorId adminVendorId, const char * paaTrustStorePath, bool useTestCommissioner, bool enableServerInteractions, CASEAuthTag * caseAuthTags, uint32_t caseAuthTagLen, chip::python::pychip_P256Keypair * operationalKey)
Which is hard to maintain, it would be nice to define a struct:
struct AllocateControllerParams { OpCredsContext * context; FabricId fabricId; chip::NodeId nodeId; chip::VendorId adminVendorId; const char * paaTrustStorePath; bool useTestCommissioner; bool enableServerInteractions; CASEAuthTag * caseAuthTags; uint32_t caseAuthTagLen; chip::python::pychip_P256Keypair * operationalKey; };
And rewrite it into:
PyChipError pychip_OpCreds_AllocateController(const AllocateControllerParams* params, chip::Controller::DeviceCommissioner ** outDevCtrl);
To make it clearer.
python
No response
CI tested
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Reproduction steps
We have lots of APIs looks like:
Which is hard to maintain, it would be nice to define a struct:
And rewrite it into:
To make it clearer.
Platform
python
Platform Version(s)
No response
Type
CI tested
(Optional) If manually tested please explain why this is only manually tested
No response
Anything else?
No response