zoukankan      html  css  js  c++  java
  • Examples

    记录一下自己平时调试蓝牙的命令,后续学习到再添加

    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

  • 相关阅读:
    元素的ID和Name有什么区别???[转自"天道酬勤"]
    招聘时会问到的问题
    关于asp.net开发B/S应用系统的思索和讨论
    软件文档知多少?
    C# 编码规范和编程好习惯
    [转]多层结构来开发ASP.NET程序
    ASP.NET页面间的传值的几种方法
    为sql server 表数据生成创建的储存过程(生成insert 脚本)
    XHTML+CSS应用教程——利用CSS实现双语导航条
    XHTML+CSS应用教程——CSS实现文字的双影
  • 原文地址:https://www.cnblogs.com/hjj801006/p/12930474.html
Copyright © 2011-2022 走看看