Skip to content

Python inout fn parameters #44

@nchokoev

Description

@nchokoev

What's the right way of using inout params in Python.
What I do is create Reference class, but it doesn't seem to work.
The issue is:

  1. At the top of a function there is an assert checking for Reference class:
    {% for p in fn.outParameters if not p.serializedViaMember %} assert type({$p.name}) is erpc.Reference, "{$p.direction} parameter must be a Reference object" {% endfor -- outParams %}
  2. Few lines below, the parameters are serialized
    {% for p in fn.inParameters if not p.serializedViaMember %}
    which in
    {% def encodeValue(info, name, codec, indent, depth) %}
    resolves to:
    {$name}._write({$codec}){%>%}

,but the {$name} has no member _write as it is of class Reference.
It probably should be something like:
{$name}.value._write({$codec}){%>%}
in this case, but not in the case for in function parameter, only for inout.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions