COVESA / COVESA/ifex

Expand `range` section with rules and implementation notes

Open
#78 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
24
Forks
24
PR merge metrics
No merged PRs in 30d

Description

Add an implementation note that specifies:

## Range-checking runtime code generation
Range checking code, verifying `in`, `out`, `error`, and property values against the permitted values specified by the `range` expression, should be optionally emitted by a code generator only when a command line flag specifies it.

Alternatively, code can be always-generated but turned on and off during runtime using a feature switch.

## Default range
Add a sub section to the range section specifying

- If no range is specified, the storage capacity of the underlying datatype is used (int16, etc).
- For complex types, the datatype of each member specifies its range.
- For strings there is no default range.

## Range check priority
Add a sub section to the range section specifying that the following range checks will all have to pass in order for a verified value to be considered legal:

- The value has to be within the storage capacity of the underlying datatype **and**
- If the parameter is `typedef`-defined type, the value has to be permitted by the range expression of the `typedef` **and**
- If the parameter is an array and `arraysize` is specified, the array element index has to be within the boundaries specified by `arraysize` **and**
- If the parameter is an array and `arraysize` is not specified, the array element index has to be lesser than or equal to the number of elements in the dynamic value array **and**
- The value is permitted according to the `range` expression of the the `method`, `event`, or `property` that transmits the value.

## Range checks are executed on the client side
Add implementation note that recommends the range check code (if generated) is to be run on the client side of a `method`, `event`, and property-setting call, removing the risk of invalid parameters being transmitted over the network.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the existing `range` section in the documentation and read its surrounding terminology first. Add the requested implementation, default-range, priority, and client-side checking notes; done when each listed rule is documented clearly and the section remains consistent.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.