1

当我跑

user:~$ obdsim -b

我明白了

obdsim: invalid option -- 'b'

我已经这样做了:

sudo rfcomm bind 0 14:30:C6:50:12:16 1
sudo sdptool add SP

当我跑

user:~$ obdsim -h
Usage: obdsim [params]
   [-g|--generator=<name of generator>
       [-s|--seed=<generator-seed>]
       [-d|--customdelay=<ecu delay(ms)>]
     ]
   [-q|--logfile=<logfilename to write to>]
   [-V|--elm-version=<pretend to be this on ATZ>]
   [-D|--elm-device=<pretend to be this on AT@1>]
   [-L|--list-protocols]
   [-p|--protocol=<OBDII protocol>]
   [-o|--launch-logger]
   [-c|--launch-screen] ["EXIT" or C-a,k to exit]
   [-t|--tty-device=<real /dev/ entry to open>]
   [-e|--genhelp=<name of generator>]
   [-l|--list-generators]
   [-n|--benchmark=<seconds>]
   [-v|--version] [-h|--help]
The generators built into this sim:
 "Random"
 "Cycle" (default)
 "Logger"
 "dlopen"
 "Socket"
 "gui_fltk"
 "Error"

所以它似乎-b不存在,但它在这里。那么我想如何连接到蓝牙?

4

1 回答 1

3

原始 OBDSim 开发人员在这里。

这是没有编译蓝牙的典型情况。 CMakeLists.txt 的相关部分是:

SET(OBD_SIM_DISABLE_BLUEZ false CACHE BOOL "Disable bluetooth support in obdsim")
IF(NOT OBD_SIM_DISABLE_BLUEZ)
    CHECK_SYMBOL_EXISTS(BTPROTO_RFCOMM
        bluetooth/bluetooth.h
            HAVE_BLUETOOTH)
    IF(HAVE_BLUETOOTH)
        MESSAGE(STATUS "Enabling bluetooth obdsim port")
        ADD_DEFINITIONS(-DHAVE_BLUETOOTH)
    ENDIF(HAVE_BLUETOOTH)
ENDIF(NOT OBD_SIM_DISABLE_BLUEZ)

所以...除非您在构建 OBDSim 时明确禁用蓝牙,否则仅意味着您需要包含您的发行版的 bluetooth-devel 包。

[请注意,安装后,您需要重新运行 cmake,清除缓存。我通常只是 rm -rf build 并重新开始]

于 2014-09-12T15:57:32.083 回答