• <li id="00i08"><input id="00i08"></input></li>
  • <sup id="00i08"><tbody id="00i08"></tbody></sup>
    <abbr id="00i08"></abbr>
  • 博客專欄

    EEPW首頁 > 博客 > 藍牙bluez命令

    藍牙bluez命令

    發布人:電子禪石 時間:2021-05-14 來源:工程師 發布文章

    記錄一下自己平時調試藍牙的命令,后續學習到再添加

     

    sdptool命令:

    sdptool add SP    - 添加SPP:

    sdptool add --channel=1 DID SP DUN LAN FAX OPUSH FTP HS HF SAP NAP GN PANU HID CIP CTP A2SRC A2SNK SYNCML NOKID PCSUITE SR1

    sdptool brower local - 查看適配器提供的功能

     

    bluetoothctl 命令:

    bluetoothctl scan on 掃描
    bluetoothctl agent on 代理
    bluetoothctl default-agent 默認代理
    bluetoothctl trust xx:xx:xx:xx:CF:F0 信任
    bluetoothctl pair xx:xx:xx:xx:CF:F0 配對

     

    命令行進入: bluetoothctl

    查看:default-agent

    注冊agent:agent on

    掃描:scan on

    停止掃描:scan off

    找到要配對的藍牙:pair xx:xx:xx:xx:xx:xx

    添加信任:trust xx:xx:xx:xx:xx:xx

    連接:connect xx:xx:xx:xx:xx:xx

    設置藍牙可被發現狀態:discoverable yes

     

    rfcomm命令:

    mknod /dev/rfcomm0 c 216 0   ---216是RFCOMM設備號

    rfcomm bind 0 xx:xx:xx:xx:CF:F0 綁定設備

    rfcomm connect 0  xx:xx:xx:xx:CF:F0 1連接設備

    rfcomm show 0  查看設備狀態

    cat >/dev/rfcomm0 寫數據

    rfcomm release 0 解綁

     

    rfcomm watch /dev/rfcomm0 3 /sbin/agetty rfcomm0 linux 115200   --沒用過

     

    hciconfig命令:

    hciconfig hci0 piscan 可使設備既可見
    hciconfig -a   查看hci詳細信息
    hciconfig hci0 sspmode disable #關閉簡易配對模式 enable為使能簡易配對
    hciconfig hci0 sspmode #查看簡易配對模式狀態

    hciconfig hci0 up

    hciconfig hci0 down

     

     

    hciattach命令:

    hciattach /dev/ttyACM1 any   

     

    linux藍牙配置文件:

    Bluetoothd保存的對端設備的信息:
    /var/lib/bluetooth/

    bluetooth配置:
    /etc/bluetooth/

    /usr/lib/systemd/system/bluetooth.service

    /sys/class/bluetooth/

    dbus中系統總線的配置
    /etc/dbus-1/system.d/bluetooth.conf

     

    bluetooth service和bluetoothd進程:


    service --status-all | grep blue        -查看是否存在bluetooth service


    ps -ef|grep blue    -查看是否存在bluetoothd進程

    service bluetooth start      -開啟bluetooth service

    service bluetooth stop   -停止bluetooth service

     

    停止bluetoothd進程方法:
    rfkill block bluetooth
    sudo service bluetooth stop
    rfkill unblock bluetooth

    bluetoothd -n -d - 啟動bluetoothd


    *博客內容為網友個人發布,僅代表博主個人觀點,如有侵權請聯系工作人員刪除。



    關鍵詞: bluetooth

    相關推薦

    技術專區

    關閉
    主站蜘蛛池模板: 巴林右旗| 克拉玛依市| 郧西县| 巴马| 宾阳县| 禹城市| 略阳县| 甘孜| 汕尾市| 兴义市| 长泰县| 凤庆县| 巴中市| 兰西县| 荆门市| 舒城县| 彰武县| 东港市| 本溪市| 梅河口市| 滦平县| 竹溪县| 阿图什市| 贡觉县| 安泽县| 若尔盖县| 临泽县| 西安市| 肥乡县| 思茅市| 柏乡县| 玛纳斯县| 壤塘县| 万盛区| 美姑县| 海宁市| 宝应县| 东安县| 孟村| 民县| 新竹县|