Skip to content

Changing rpc constants on proxy#214

Open
heevasti wants to merge 18 commits into
mainfrom
changing-rpc-constants-on-proxy
Open

Changing rpc constants on proxy#214
heevasti wants to merge 18 commits into
mainfrom
changing-rpc-constants-on-proxy

Conversation

@heevasti

@heevasti heevasti commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Related to #213.

With this, the "RPC constants" that are class constants on a RPC object, e.g. QMI_Instrument, have been renamed to "RPC properties, and can now be modified so that the modifications propagate back to the actual object, and not proxy only. With this, the proxy class of the object was also made prohibitive on adding new class attributes, RPC properties can only be modified with same type (and size if applicable) values, and also class constants not defined with _rpc_properties are not modifiable and will lead to an AttributeError.

Further checks are made that the given _rpc_properties values are not referring to e.g. a method, QMI signal attribute, property, etc. Invalid naming will raise a QMI_UsageError.

_rpc_constants use will now give a deprecation warning, and will be handled the same way as the _rpc_properties.

Some tutorial examples were also added to illustrate this new functionality.

Henri Ervasti and others added 15 commits May 19, 2026 17:07
…the class constants marked with `_rpc_constants = ["constant_a", "constant_b", ...]` can be changed by calling `class_rpc_proxy_inst.constant_a(new_value)`. The new value must be of same type and length as the original value to be able to change the value. This means that e.g. `None` cannot be used to set the RPC constant as 'optional', and the constant cannot have union of types either. Need to edit the documentation about this still.
…thout a new value to return the current value.
…t value calls to be settables and gettables instead, so that they can be modified like any class attribute.
…ts definition in serial device transport string docstring in `create_transport`.
…_rpc_constants names so that no method names nor QMI signal names etc. can (accidentally) be named as _rpc_constants. But it makes several unittests to fail now.
…stants` to be a `set` type. Added more robust checking of the RPC constants so that giving any method, property, class name or QMI signal is not allowed. Boy-scouted a bug in `datastore.py`.
@heevasti heevasti requested a review from pieterjbotma June 11, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant