Skip to content

optimizer incorrectly handles report count #7

@ajmirsky

Description

@ajmirsky
>> cat test.py
from hrdc.usage import *
from hrdc.descriptor import *

descriptor = Collection(Collection.Application, sensors.Environmental,
    Collection(Collection.Physical, sensors.Environmental,
        Report(1,
            Value(Value.Input, sensors.EnvironmentalHumidity, 16, logicalMin = 0, logicalMax = 1400),
            Value(Value.Input, sensors.EnvironmentalTemperature, 8, logicalMin = 0, logicalMax = 100, count = 2),
            Value(Value.Input, sensors.EnvironmentalAtmosphericPressure, 8, logicalMin = 0, logicalMax = 100),
        ),
    ),
)
compile_main(descriptor)

>> python test.py --output=hex

generates

05 20
09 30
a1 01
09 30
a1 00
85 01
15 00
26 78 05
75 10
95 01
09 32
81 02
09 33
25 64
75 08    
             << Value Input is missing a report count, it should have a report count = 2 (95 02)
09 31
95 03    << report count is 3, but should be report count = 1 (95 01)
81 02
c0
c0

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