Use C API in Web Application
Posted: Fri May 26, 2023 1:25 pm
Hello everyone,
I am trying to read 4 slow ADC values from expansion connector. Noticed that C API rp_ApinGetValue() can do this. I followed the instruction https://redpitaya.readthedocs.io/en/lat ... .html#comc, and the results were good! However, the Makefile of the example code "analog_inputs.c" is static linked to libm.a/librp.a. And I hope to use it function in my Web Application. My web application is based on rp_lockin+PID. The makefile target is a shared library(.so). When I replace "-static" flag by "-shared" and "-fPIC", a Segmentation Error occurred. I don't know what the problem is, is it that this function can't get through the dynamic link? Or is there a way to use rp_ApinGetValue() in a web application? If not, I'd be happy to look at better ways to satisfy my requirements, such as Qt Streaming APP/ Jupyter Notebook. I hope you will give me some advice on my route. Thanks!
I am trying to read 4 slow ADC values from expansion connector. Noticed that C API rp_ApinGetValue() can do this. I followed the instruction https://redpitaya.readthedocs.io/en/lat ... .html#comc, and the results were good! However, the Makefile of the example code "analog_inputs.c" is static linked to libm.a/librp.a. And I hope to use it function in my Web Application. My web application is based on rp_lockin+PID. The makefile target is a shared library(.so). When I replace "-static" flag by "-shared" and "-fPIC", a Segmentation Error occurred. I don't know what the problem is, is it that this function can't get through the dynamic link? Or is there a way to use rp_ApinGetValue() in a web application? If not, I'd be happy to look at better ways to satisfy my requirements, such as Qt Streaming APP/ Jupyter Notebook. I hope you will give me some advice on my route. Thanks!