spaceinventor / libparam Goto Github PK
View Code? Open in Web Editor NEWParameter system
Parameter system
Compiler: g++ 11.3.0
Expected behavior: PARAM_DEFINE_*
macros generate compiling C++ code.
Actual behavior: The compile fails with the error:
param.h:199:9: error: designator order for field ‘param_s::id’ does not match declaration order in ‘param_t’ {aka ‘param_s’}
This appears to be because in C++20, the order of designated initializers has to match the declaration order. See:
Note: out-of-order designated initialization, nested designated initialization, mixing of designated initializers and regular initializers, and designated initialization of arrays are all supported in the C programming language, but are not allowed in C++.
From https://en.cppreference.com/w/cpp/language/aggregate_initialization#Designated_initializers
It seems like this can be fixed just by re-ordering the initializers and inserting NULL initializers as needed in the PARAM_DEFINE_*
macros.
Reproducible example: In a new project directory:
Clone libcsp into lib/csp and libparam into lib/param (as done here: https://github.com/spaceinventor/csh)
meson.build file:
project('TestProgram',
'cpp',
subproject_dir: 'lib'
)
csp_dep = dependency('csp', fallback: ['csp', 'csp_dep'], required: true)
param_dep = dependency('param', fallback: ['param', 'param_dep'], required: true)
main = executable(
'main',
[ 'src/main.cpp' ],
dependencies: [csp_dep, param_dep]
)
src/main.cpp file:
#include <param/param.h>
static uint8_t _ch_on[12];
PARAM_DEFINE_REMOTE_DYNAMIC(20, ch_on, 3, PARAM_TYPE_UINT8, 12, 0, PM_CONF, &_ch_on, "");
int main() {
return 0;
}
For arrays the source pointer is not incremented
Param push single does not support NULL as value.
The function, vmem_client_find, takes as argument the version but the return type is strictly version 1. When using version 2 the result from vmem_client_list_get is vmem_list2_t but is casted to vmem_list_t causing the vaddr field to be truncated.
This discrepancy seems to have been implemented in vmem_client_list, so a similar fix would be appreciated here.
Let me know if you want us (DISCO2 software group at ITU) to make a pull request.
Hello @johandc,
Where can I locate the list of valid parameters for the BAT-P3 module? I am just getting familiar with the part by reading its datasheet, and I see a list of parameters retrieved with /bin/bash on page 9. That list is titled, "Example telemetry using ‘satctl’ with CAN-dongle on a PC".
I want to get at the description of these parameters and ideally look over their implementation in the available libparam source so that I can identify the types of the arguments as well. If these descriptions are in some document somewhere, that would do as well. Thank you.
Nuertey
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.