cpp
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| cpp [2021/08/11 11:26] – wikiadmin | cpp [2022/09/11 05:24] (current) – wikiadmin | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| <code bash> | <code bash> | ||
| mkdir build | mkdir build | ||
| + | cd build | ||
| cmake .. | cmake .. | ||
| make | make | ||
| Line 44: | Line 45: | ||
| The tool is then running and ready for connections. | The tool is then running and ready for connections. | ||
| - | The sample, even though simple, demonstrates all the features required | + | For the host,copy the GEMHostRuntime.jar from the TransSECS GEMHost project into the build folder |
| + | |||
| + | The samples, even though simple, demonstrates all the features required | ||
| + | |||
| + | In the host code, publish variables you need to change in the interface, here the port, hostname, deviceid, etc. and subscribe to elements to receive data updates. | ||
| + | |||
| + | <code c++> | ||
| + | #include < | ||
| + | #include < | ||
| + | #include < | ||
| + | #include " | ||
| + | #include < | ||
| + | #include " | ||
| + | #include < | ||
| + | #include < | ||
| + | |||
| + | transsecswrapper:: | ||
| + | |||
| + | int main(int argc, char **argv) { | ||
| + | // | ||
| + | |||
| + | int port = 5010; | ||
| + | |||
| + | // persistance file saves GEM configuration between restarts (reports, enabled CEIDs, enabled Alarms, etc). | ||
| + | gem_native_wrapper.Publish(" | ||
| + | gem_native_wrapper.Publish(" | ||
| + | gem_native_wrapper.Publish(" | ||
| + | gem_native_wrapper.Publish(" | ||
| + | gem_native_wrapper.StartMain(" | ||
| + | gem_native_wrapper.Subscribe(" | ||
| + | printf(" | ||
| + | }); | ||
| + | |||
| + | gem_native_wrapper.Subscribe(" | ||
| + | printf(" | ||
| + | }); | ||
| + | |||
| + | gem_native_wrapper.Subscribe(" | ||
| + | printf(" | ||
| + | }); | ||
| + | } | ||
| + | </ | ||
| The tool must keep the SECS interface informed of the current values of all the VIDs. This just a matter of call " | The tool must keep the SECS interface informed of the current values of all the VIDs. This just a matter of call " | ||
| + | |||
| <code C++> | <code C++> | ||
| gem_native_wrapper.Publish(" | gem_native_wrapper.Publish(" | ||
cpp.1628695595.txt.gz · Last modified: by wikiadmin
