Comments (5)
Just some thoughts, instead of appending the type to the function name, the type could be provided as an argument. If the type endianness is the same as the platform, then only the length is checked to be type size aligned, otherwise swapping is also provided. There are libraries available for swapping, but it is actually trivial the only advantage from a library would be it SIMD instructions could be used.
from scpi-parser.
It is also possible to have one function and parameter as type as you propose.
It can look like your implementation of processing of array/buffer of numbers. But this will be better to have separate functions.
This is straightforward
SCPI_ResultBufferUInt8(..., values, countof(values), NORMAL)
SCPI_ResultBufferInt32(..., values, countof(values), SWAPPED)
SCPI_ResultBufferFloat(..., values, countof(values), ASCII)
SCPI_ResultBufferDouble(..., values, countof(values), NORMAL)
This will consume all following parameters or only one arbitrary block with swapped UInt16 values.
SCPI_ParamBufferUInt16(..., values, countof(values), ASCII_OR_SWAPPED, &result_count, ...)
This will consume only one arbitrary block of NORMAL (big-endian) 64bit integers, no ASCII encoding allowed.
SCPI_ParamBufferInt64(..., values, countof(values), NORMAL, &result_count, ...)
For me, it sounds better SCPI_ResultArrayFloat
then SCPI_ResultBufferFloat
, for that purpose.
We can also officially divide SCPI_ResultArbitraryBlock
into two functions - SCPI_ResultArbitraryBlockHeader
and SCPI_ResultArbitraryBlockData
. You can later call SCPI_ResultArbitraryBlockData
more then once.
from scpi-parser.
I have introduced first support in 3b99af6 for returning arrays. It is still not well tested, it is not optimal but it is first step.
I would like to introduce also reading array parameters and also unit tests for all new functions.
from scpi-parser.
Result functions are now ready. They are also covered by tests.
Missing part is Parameter functions.
from scpi-parser.
Array parameters are prepared but currently support only text.
from scpi-parser.
Related Issues (20)
- C++ compilation error due to NULL being a long int HOT 1
- ip set HOT 1
- check if osThreadCreate() successful HOT 8
- Possible to have multiple, independent scpi session? HOT 4
- Example of Optional keywords/Related API HOT 1
- introducing a help command HOT 5
- problem talking with sigrok HOT 5
- USE_FULL ERROR LIST report "Unknow Error" for all XE errors HOT 2
- Termination for SCPI commands HOT 3
- arm cross-compilation requires additional flags HOT 2
- Compile error when compiling with C++17 HOT 1
- vxi11.h missing ??
- Port to Arduino
- scpi-parser support on windows? HOT 1
- Documentation out of date?
- How the MAV bit is setting in Status register. HOT 1
- Handle errors from the read/write method HOT 11
- [Feature request] Add support to handle numerical values in choice list
- TEST_Chanlst upper limit fails HOT 1
- Parsing decimal values HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scpi-parser.