Skip to content

default value bug

Amy Blank requested to merge feature/default-value-bug into devel

Description

The object dictionary was not being properly generated for the new puck yaml. Here were the issues I ran into:

  1. ${ID} and ${NAMESPACE} need to be replaced with 6 and teneo, respectively, to run objdict_generate in a standalone context. When building the mainboard firmware, the makefile replaces these before running objdict_generate. This is not actually an issue, just a thing that is important to understand for testing.
  2. The eds_generate function expects that, if an index has multiple subindices, the first is 0 and the second is 1. The original yaml file did not have the subindex 0, so I added that entry (since it does exist, even though we don't need it for the mainboard). No code changes here for this.
  3. The eds_generate function usually has a conditional on the existence of a default value to make it not required. However, for entries with subindex 1, there was no conditional. So I added a conditional.

How to test

  1. Clone/checkout this version of objdict_generate
  2. Install with sudo ./setup.py install
  3. Download the .yaml file linked under Resources below
  4. Run the following command
objdict_generate <path/to/*.yaml> -o <output_folder>

Reviewers

Resources

Here is the yaml file I used for testing, which has been modified from the one provided to me in the following ways:

  • Replaced ${ID} and ${NAMESPACE} need to be replaced with "6" and "teneo", respectively (see 1 above)
  • Added the following entry based on specification here (see 2 above for rationale)
- index: 0x2205
   subindex: 0
   name: GripSensorDataRecord
   datatype: U8
   access: RO
   save: false
   comment: "Grip Sensor Data Record"
   export_for_mainboard: false
  • Updated data types to match specification here
Edited by Brian Zenowich

Merge request reports

Loading