Hi Janez,
I recently wrote an areaDetector plugin that needs to parse JSON. It is here:
https://github.com/areaDetector/ADCore/blob/master/ADApp/pluginSrc/NDPluginBadPixel.cpp
I used this very nice C++ parser:
https://github.com/nlohmann/json
It is just a C++ header file, so no library is needed.
I think you could write a simple asynPortDriver that uses drvAsynIPPort for the HTTP gets and the JSON parser to do what you want.
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Govednik, Janez via Tech-talk
Sent: Monday, May 9, 2022 2:50 PM
To: tech-talk at aps.anl.gov
Subject: INFICON Transpector MPH Residual Gas Analyzer (RGA) - http GET requests.
We want to develop an EPICS support for Residual Gas Analyzer from Inficon. Unfortunately, RGA is running a web server which is listening for http GET requests on port 80. The response
from the web server is in JSON format. My question is if somebody already develop an IOC for this type of device? If not, what would be the best solution? We were thinking that using simple stream device support and .proto file might be too messy in this case.
Is there a library for http requests and simple JSON parser if we make our own support? Do you have an example of http device support or use of JSON parser?
Here are two examples of the request and response (what you see in the web browser):
-
/mmsp/scanSetup/channel/1/get
{
"reportType": "Absolute",
"reportUnits": "Current",
"origin": "/mmsp/scanSetup/channel/1"
}
· /mmsp/measurement/scans
· {
"origin": "/mmsp/measurement/scans",
}
Thanks in advance!
Best,
|