参考ibeoSDk README 手册
无MONGODB版
ubuntu 16.04 boost 1_59_0
1. 生成ibeoSDK library
打开SHELL窗口
进入SDK所在文件夹
make static 生成 static liberary 或者 make shared 生成shared library
make 可用选项
shared Build ibeosdk as shared library
shareddemos Build ibeosdk as shared library and demos using the shared library (demo binary will end with suffix _shared).
static Build ibeosdk as static library
staticdemos Build ibeosdk as static library and demos using the shared library (demo binary will end with suffix _static).
clean Delete all object files and dependency files (*.o .d) and demo binaries.
democlean Delete all demo binaries and demo object files and dependence files.
distclean Like clean and the libs folder will be erased as well
docs Create a documentation from the doxygen comments. The result can be found in docs/html/index.html
docsclean Delete all generated documentation.
all Will generate the ibeosdk object files (static flags) and link them directly to the demo binaries (no lib will be generated, demo binaries won't have a suffix).
生成的库文件将存储在IbeoSDK/libs
2.使用官方DEMO
进入SDK所在的根目录 ,
mkdir build
cd build
cmake ..
生成的Demo存放在ibeosdk/src/demo
以 ./ Demo_name IP地址 的格式调用即可。
3.编写程序
根据所连接的设备,对应选择头文件:
IbeoLux include: <ibeosdk/lux.hpp>
IbeoEcu include: <ibeosdk/ecu.hpp>
IbeoScala include: <ibeosdk/scala.hpp>
IbeoMiniLux include: <iboesdk/minilux.hpp>IbeoSdkEcuLiveDemo:
AllEcuListener where all listeners gathered into one single class)
选择你所感兴趣的信号类型,建立相应的listenr类(参照IbeoSDKFIleDemo中的MyScanListener, MyObjectListener ,在IbeoSdkEcuLiveDemo:
所有的listener集中于AllEcuListener )
步骤:
1. Create the listener objects.
2. Create the IbeoDevice providing the IP address and port as parameters.
3. Optional: Set the devices LogFileManger
4. Register all listener
5. Establish connection between the hardware and the IbeoDevice class.
注意:
通过调用exit(cstdlib)退出程序。
如果建立的是静态libibeosdk 在linux需要通过link选项连接 --whole-archive (g++ 命令行使用”-WI,--whole-archive);
为了避免类名称冲突 不要使用using namespace ibeosdk;