redhawksdr - REDHAWK Python component calls legacy C-code -
is there referred method of calling c-code python component? porting redhawk csh script calls c-code programs (with "main" entry points , argument lists). prefer implement csh script python component, call c-code programs.
couple of notes:
- i'm familiar doing in swig in gnu radio.
- i acknowledge bigger issue of rearchitecting entire system connected sdr components, fundamental c-from-python issue remains.
this interesting question. have access source code traditional "main" application? statement swig suggest do. if do, best approach may use shared library pattern discussed in section 4.9 of redhawk manual. problem either swig or shared library approach require restructuring of legacy c application shared library. if legacy form of batch processor takes in commands , data , pushes out results, may best using fork/exec paradigm. i'm making huge assumptions here, if legacy app puts output on stdout, can attach stdout pipe read in component shell.
the redhawk gpp thing mention above component applications , can see how done here
i made lot of assumptions in answering this. if provide more detail constraints may able refine answer.
additional thought: if decide want quick-result, there great post on stackoverflow under question 'python-c-wrapper-for-reading-variable-argument-lengths' , running in redhawk generated python component pretty quickly. i'm not sure how results legacy app.
Comments
Post a Comment