Skip to content

Encoding INTEGER with set of allowed values #193

@maxime-esa

Description

@maxime-esa

Consider this type:

MyType ::= INTEGER (0 | 100)

If not wrong, using uPER I'd expect to use one bit for the encoding as there are 2 possible values.
EDIT actually this assumption is probably wrong, uPER would compute the number of bits based on a range (0..100) - but this leaves the open question:

However, I can't get any output:

>>> foo = asn1tools.compile_files('test.asn', 'uper')
>>> encoded = foo.encode('MyType', 100)
>>> encoded
b''    # Nothing?

Any idea?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions