default value bug
Description
The object dictionary was not being properly generated for the new puck yaml. Here were the issues I ran into:
-
${ID}
and${NAMESPACE}
need to be replaced with6
andteneo
, respectively, to runobjdict_generate
in a standalone context. When building the mainboard firmware, themakefile
replaces these before runningobjdict_generate
. This is not actually an issue, just a thing that is important to understand for testing. - 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. - 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
- Clone/checkout this version of objdict_generate
- Install with
sudo ./setup.py install
- Download the .yaml file linked under Resources below
- 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