zoukankan      html  css  js  c++  java
  • 在Linux下蓝牙进行rfcomm连接

    折腾了半天终于搞定了,开心 用的是bluez3.36,大概说一下流程 1. 配置/etc/bluetooth/rfcomm.conf
    rfcomm0 {
    #       # Automatically bind the device at startup
            bind no;
    #
    #       # Bluetooth address of the device
            device XX:XX:XX:XX:XX:XX;
    #
    #       # RFCOMM channel for the connection
            channel 1;
    #
    #       # Description of the connection
            comment "Example Bluetooth device";
    }
    
    2. 关闭本地pin验证 1)
    hciconfig hci0 noauth ; # 关闭本地的pin验证
    
    3. 设置连接pin码 编辑/var/lib/bluetooth/XX:XX:XX:XX:XX:XX/pincodes (XX:XX:XX:XX:XX:XX为本地设备地址) 文件格式为: XX:XX:XX:XX:XX:XX 1234 (XX:XX:XX:XX:XX:XX为目标设备地址) 4. 运行
    mknod /dev/rfcomm0 c 216 0
    chmod 666 /dev/rfcomm0
    rfcomm connect 0;
    
    5. 输出字符到蓝牙串口
    echo y>/dev/rfcomm0
    
  • 相关阅读:
    bzoj4289
    bzoj3033
    bzoj3144
    896C
    bzoj4430
    bzoj4455
    bzoj5117
    BZOJ 1564: [NOI2009]二叉查找树
    BZOJ1261: [SCOI2006]zh_tree
    BZOJ1090: [SCOI2003]字符串折叠
  • 原文地址:https://www.cnblogs.com/TLightSky/p/2941472.html
Copyright © 2011-2022 走看看