Skip to content

Sensor graph compiler's script format broken for array config variables #980

Description

@anwu

Looks like the script format for the sensor graph compiler doesn't work when setting config variables that are arrays. It works just fine when using the snippet format.

C:\Arch\coretools\iotilesensorgraph\test\sensor_graphs> iotile-sgcompile .\basic_config.sgf -f script -o test
Traceback (most recent call last):
  File "C:\Arch\firmware\workspace\env_p38\Scripts\iotile-sgcompile-script.py", line 11, in <module>
    load_entry_point('iotile-sensorgraph', 'console_scripts', 'iotile-sgcompile')()
  File "c:\arch\coretools\iotilesensorgraph\iotile\sg\scripts\iotile_sgcompile.py", line 85, in main
    output = output_format.format(parser.sensor_graph)
  File "c:\arch\coretools\iotilesensorgraph\iotile\sg\output_formats\script.py", line 48, in format_script
    byte_value = _convert_to_bytes(config_type, value)
  File "c:\arch\coretools\iotilesensorgraph\iotile\sg\output_formats\script.py", line 71, in _convert_to_bytes
    raise ArgumentError('Type must be a known integer type, integer type array, string', known_integers=int_types.keys(), actual_type=type_name)
typedargs.exceptions.ArgumentError: ArgumentError: Type must be a known integer type, integer type array, string
Additional Information:
known_integers: dict_keys(['uint8_t', 'int8_t', 'uint16_t', 'int16_t', 'uint32_t', 'int32_t'])
actual_type: uint8_t[]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions