Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large arbitrary block of data #95

Open
mvladic opened this issue Nov 15, 2017 · 4 comments
Open

Large arbitrary block of data #95

mvladic opened this issue Nov 15, 2017 · 4 comments

Comments

@mvladic
Copy link

mvladic commented Nov 15, 2017

Hi!

I would like to transfer a large arbitrary block data to the device, chunk by chunk, since it can't fit all at once inside device RAM memory. Currently, I think, SCPI_ParamArbitraryBlock expects whole block to be inside the memory. Is there any other strategy to do this?

For the other way around, when I need to transfer large arbitrary block from device, I can use SCPI_ResultArbitraryBlockHeader and then SCPI_ResultArbitraryBlockData multiple times and it works fantastic!

For the context, let me tell you that I transfer data from PC to the SD card on the device, and vice versa.

@mvladic
Copy link
Author

mvladic commented Nov 15, 2017

I just figured out one strategy to do this. I will send one chunk of data with one SCPI command, i.e. each chunk will be different SCPI command.

For example, to transfer file from PC to device, I will do the following:

MMEMory:DOWNload:FNAMe "/lists/sin.csv"
MMEMory:DOWNload:DATA #264.... // send 1st 64 bytes
MMEMory:DOWNload:DATA #264.... // send 2nd 64 bytes
...

@cdwork
Copy link
Contributor

cdwork commented Nov 15, 2017

Hi!
See this post: #80

@j123b567
Copy link
Owner

This is good workaround.

Current library design dos not support messages larger then the buffer. This is also the reason, I can't support indefinite format of arbitrary data, see issue #24.

Another approach would be, to add another API to the library. User will define user handler just for

  • detection of command header
  • detection of parameter, it can be called multiple times for one ARB parameter
  • detection of end of command

Detection of correct command will be on responsibility of the user of the library.

This is how another parsers works e.g. https://github.com/nodejs/http-parser

@mvladic
Copy link
Author

mvladic commented Nov 15, 2017

I think I can live with the workaround. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants