• linux 用蓝牙和手机通信


    http://hh8shyy.blog.51cto.com/697059/172007

    加载模块: 

    # modprobe hci_usb
    
       # modprobe rfcomm
       # hciconfig hci0 up
    # hciconfig hci0 up
    查看状况: 
    # hciconfig -a

    hci0:   Type: USB
            BD Address: 00:10:60:A3:68:9F ACL MTU: 192:8  SCO MTU: 64:8
            UP RUNNING PSCAN ISCAN
            RX bytes:1860 acl:10 sco:0 events:88 errors:0
            TX bytes:1432 acl:10 sco:0 commands:52 errors:0
            Features: 0xff 0xff 0x0f 0x00
            Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
            Link policy: HOLD SNIFF PARK
            Link mode: SLAVE ACCEPT
            Name: 'Debian'
            Class: 0x000100
            Service Classes: Unspecified
            Device Class: Computer, Uncategorized
            HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
            Manufacturer: Cambridge Silicon Radio (10)

    扫描周围蓝牙设备:
    # hcitool scan
    

    Scanning...
          00:80:37:B5:A8:3A     T68i
          00:0E:07:1C:AE:1D     T628
    Ping一下看看:
    # l2ping 00:0E:07:1C:AE:1D   #(l2ping,是小写的L而不是数字1)
    

    Ping: 00:0E:07:1C:AE:1D from 00:10:60:A3:68:9F (data size 20) ...
    0 bytes from 00:0E:07:1C:AE:1D id 200 time 39.62ms
    0 bytes from 00:0E:07:1C:AE:1D id 201 time 35.25ms
    0 bytes from 00:0E:07:1C:AE:1D id 202 time 33.60ms
    0 bytes from 00:0E:07:1C:AE:1D id 203 time 40.57ms
    0 bytes from 00:0E:07:1C:AE:1D id 204 time 38.96ms
    0 bytes from 00:0E:07:1C:AE:1D id 205 time 34.60ms
    6 sent, 6 received, 0% loss
    本地主机配置文件(主机名等参数):       
    /etc/bluetooth/hcid.conf
    PIN配对码所在文件:      
    /etc/bluetooth/pin
    加载配置文件:      
    #hcid -f /etc/bluetooth/hcid.conf
  • 相关阅读:
    四、运算符
    三、Golang 变量
    二、Golang的概述
    一、Golang开山篇
    部分技术使用
    Teleport_实战
    zabbix_浅谈
    渗透测试工具集合(漏洞练习平台)
    常见开源监控软件的介绍
    Ansible-大保健
  • 原文地址:https://www.cnblogs.com/leaven/p/1626203.html
Copyright © 2020-2023  润新知