pi@raspberrypi:~ $ bluetooth
bluetoothctl  bluetoothd


pi@raspberrypi:~ $ bluetoothctl
Agent registered


[bluetooth]# show
Controller DC:A6:32:1B:77:A1 (public)
        Name: raspberrypi
        Alias: raspberrypi
        Class: 0x00480000
        Powered: yes
        Discoverable: no
        Pairable: yes
        UUID: Headset AG                (00001112-0000-1000-8000-00805f9b34fb)
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
        Modalias: usb:v1D6Bp0246d0532
        Discovering: no

[bluetooth]# help
Menu main:
Available commands:
-------------------
advertise                                         Advertise Options Submenu
scan                                              Scan Options Submenu
gatt                                              Generic Attribute Submenu
list                                              List available controllers
show [ctrl]                                       Controller information
select <ctrl>                                     Select default controller
devices                                           List available devices
paired-devices                                    List paired devices
system-alias <name>                               Set controller alias
reset-alias                                       Reset controller alias
power <on/off>                                    Set controller power
pairable <on/off>                                 Set controller pairable mode
discoverable <on/off>                             Set controller discoverable mode
agent <on/off/capability>                         Enable/disable agent with given capability
default-agent                                     Set agent as the default one
advertise <on/off/type>                           Enable/disable advertising with given type
set-alias <alias>                                 Set device alias
scan <on/off>                                     Scan for devices
info [dev]                                        Device information
pair [dev]                                        Pair with device
trust [dev]                                       Trust device
untrust [dev]                                     Untrust device
block [dev]                                       Block device
unblock [dev]                                     Unblock device
remove <dev>                                      Remove device
connect <dev>                                     Connect device
disconnect [dev]                                  Disconnect device
menu <name>                                       Select submenu
version                                           Display version
quit                                              Quit program
exit                                              Quit program
help                                              Display help about this program
export                                            Print evironment variables

[bluetooth]# scan on
Discovery started
[CHG] Controller DC:A6:32:1B:77:A1 Discovering: yes
[NEW] Device 50:EC:50:8B:E3:B8 Qingping Bluetooth Gateway
[NEW] Device 04:CF:8C:24:88:1D 04-CF-8C-24-88-1D
[NEW] Device 44:23:7C:32:A0:0F 44-23-7C-32-A0-0F
[CHG] Device 04:CF:8C:24:88:1D Name: Qingping Bluetooth Gateway
[CHG] Device 04:CF:8C:24:88:1D Alias: Qingping Bluetooth Gateway
[NEW] Device 44:BE:CE:D6:68:20 44-BE-CE-D6-68-20
[NEW] Device 40:31:3C:BC:7E:13 40-31-3C-BC-7E-13
[NEW] Device 20:FA:BB:06:87:41 PHANTOM
[NEW] Device 58:2D:34:39:0C:01 58-2D-34-39-0C-01
[NEW] Device E5:EC:43:09:83:73 E5-EC-43-09-83-73
[NEW] Device 88:0F:10:81:09:69 88-0F-10-81-09-69
[NEW] Device 44:23:7C:2F:F4:8E 44-23-7C-2F-F4-8E
[NEW] Device 72:07:FD:A2:1D:E3 안방
[NEW] Device 50:EC:50:8C:53:4C 50-EC-50-8C-53-4C
[NEW] Device 54:AB:8C:D4:78:03 54-AB-8C-D4-78-03
[NEW] Device A4:C1:38:71:95:9D LYWSD03MMC
[CHG] Device 88:0F:10:81:09:69 Name: MI_SCALE
[CHG] Device 88:0F:10:81:09:69 Alias: MI_SCALE
[NEW] Device 8C:C8:4B:BD:88:FA 8C-C8-4B-BD-88-FA
[NEW] Device 24:41:8C:64:81:00 AW-AREA-51M
[NEW] Device 00:04:4B:F0:6A:47 00-04-4B-F0-6A-47
[CHG] Device 00:04:4B:F0:6A:47 Name: SHIELD
[CHG] Device 00:04:4B:F0:6A:47 Alias: SHIELD
[CHG] Device 00:04:4B:F0:6A:47 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Device 00:04:4B:F0:6A:47 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 00:04:4B:F0:6A:47 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 00:04:4B:F0:6A:47 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 00:04:4B:F0:6A:47 UUIDs: 00000000-0000-0000-0000-000000000000
[CHG] Device 8C:C8:4B:BD:88:FA Name: BFX-AT100
[CHG] Device 8C:C8:4B:BD:88:FA Alias: BFX-AT100
[CHG] Device 8C:C8:4B:BD:88:FA UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Device 8C:C8:4B:BD:88:FA UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 8C:C8:4B:BD:88:FA UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 8C:C8:4B:BD:88:FA UUIDs: 00001115-0000-1000-8000-00805f9b34fb
[CHG] Device 8C:C8:4B:BD:88:FA UUIDs: 00001116-0000-1000-8000-00805f9b34fb
[CHG] Device 8C:C8:4B:BD:88:FA UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 8C:C8:4B:BD:88:FA UUIDs: 00000000-0000-0000-0000-000000000000
[CHG] Device A4:C1:38:71:95:9D RSSI: -65
[CHG] Device 72:07:FD:A2:1D:E3 RSSI: -74
[CHG] Device 50:EC:50:8C:53:4C Name: Qingping Bluetooth Gateway
[CHG] Device 50:EC:50:8C:53:4C Alias: Qingping Bluetooth Gateway
[CHG] Device 58:2D:34:39:0C:01 Name: MJ_HT_V1
[CHG] Device 58:2D:34:39:0C:01 Alias: MJ_HT_V1
[CHG] Device 58:2D:34:39:0C:01 UUIDs: 0000180f-0000-1000-8000-00805f9b34fb
[CHG] Device 58:2D:34:39:0C:01 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Device 58:2D:34:39:0C:01 ServiceData Key: 0000fe95-0000-1000-8000-00805f9b34fb
[CHG] Device 58:2D:34:39:0C:01 ServiceData Value:
  50 20 aa 01 bc 01 0c 39 34 2d 58 06 10 02 57 02  P .....94-X...W.
[CHG] Device 58:2D:34:39:0C:01 ServiceData Key: 0000ffff-0000-1000-8000-00805f9b34fb
[CHG] Device 58:2D:34:39:0C:01 ServiceData Value:
  c8 bc cb 06 f5 19                                ......
[CHG] Device 24:41:8C:64:81:00 RSSI: -38
[CHG] Device 8C:C8:4B:BD:88:FA RSSI: -63

[bluetooth]# scan off
[CHG] Device 04:CF:8C:24:88:1D RSSI is nil
[DEL] Device 04:CF:8C:24:88:1D Qingping Bluetooth Gateway
[CHG] Device 44:23:7C:32:A0:0F RSSI is nil
[DEL] Device 44:23:7C:32:A0:0F 44-23-7C-32-A0-0F
[CHG] Device 44:23:7C:2F:F4:8E RSSI is nil
[DEL] Device 44:23:7C:2F:F4:8E 44-23-7C-2F-F4-8E
[CHG] Device 50:EC:50:8C:53:4C RSSI is nil
[DEL] Device 50:EC:50:8C:53:4C Qingping Bluetooth Gateway
[CHG] Device A4:C1:38:D2:68:68 RSSI is nil
[CHG] Device 00:04:4B:F0:6A:47 RSSI is nil
[CHG] Device 24:41:8C:64:81:00 TxPower is nil
[CHG] Device 24:41:8C:64:81:00 RSSI is nil
[CHG] Device 8C:C8:4B:BD:88:FA RSSI is nil
[CHG] Device A4:C1:38:71:95:9D RSSI is nil
[CHG] Device 54:AB:8C:D4:78:03 TxPower is nil
[CHG] Device 54:AB:8C:D4:78:03 RSSI is nil
[CHG] Device 72:07:FD:A2:1D:E3 RSSI is nil
[CHG] Device 88:0F:10:81:09:69 RSSI is nil
[CHG] Device E5:EC:43:09:83:73 RSSI is nil
[CHG] Device 58:2D:34:39:0C:01 RSSI is nil
[CHG] Device 20:FA:BB:06:87:41 RSSI is nil
[CHG] Device 40:31:3C:BC:7E:13 RSSI is nil
[CHG] Device 44:BE:CE:D6:68:20 TxPower is nil
[CHG] Device 44:BE:CE:D6:68:20 RSSI is nil
[CHG] Device 50:EC:50:8B:E3:B8 RSSI is nil
[CHG] Controller DC:A6:32:1B:77:A1 Discovering: no
Discovery stopped

[bluetooth]# info 24:41:8C:64:81:00
Device 24:41:8C:64:81:00 (public)
        Name: AW-AREA-51M
        Alias: AW-AREA-51M
        Class: 0x002a010c
        Icon: computer
        Paired: no
        Trusted: no
        Blocked: no
        Connected: no
        LegacyPairing: no
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)

에이전트를 활성화하고 기본값으로 설정합니다. 페어링 핀 코드를 요청 및 확인을 하기 위해 필요합니다.[bluetooth]# agent on
Agent is already registered

[bluetooth]# default-agent
Default agent request successful

[bluetooth]# pair 24:41:8C:64:81:00
Attempting to pair with 24:41:8C:64:81:00
[CHG] Device 24:41:8C:64:81:00 Connected: yes
Request confirmation
[agent] Confirm passkey 196914 (yes/no): yes
[CHG] Device 24:41:8C:64:81:00 Connected: no
[CHG] Device 24:41:8C:64:81:00 Paired: yes
Pairing successful
[CHG] Device 24:41:8C:64:81:00 Connected: yes
[CHG] Device 24:41:8C:64:81:00 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 24:41:8C:64:81:00 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
Authorize service
[agent] Authorize service 0000110e-0000-1000-8000-00805f9b34fb (yes/no): yes

페어링 완료후, trust 명령을 해줘야 합니다.
[AW-AREA-51M]# trust 24:41:8C:64:81:00
[CHG] Device 24:41:8C:64:81:00 Trusted: yes
Changing 24:41:8C:64:81:00 trust succeeded

[AW-AREA-51M]# info 24:41:8C:64:81:00
Device 24:41:8C:64:81:00 (public)
        Name: AW-AREA-51M
        Alias: AW-AREA-51M
        Class: 0x002a010c
        Icon: computer
        Paired: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)

[AW-AREA-51M]# paired-devices
Device 24:41:8C:64:81:00 AW-AREA-51M

[AW-AREA-51M]# remove 24:41:8C:64:81:00
Device has been removed
[CHG] Device 24:41:8C:64:81:00 Connected: no
[DEL] Device 24:41:8C:64:81:00 AW-AREA-51M

[bluetooth]# menu gatt
Menu gatt:
Available commands:
-------------------
list-attributes [dev]                             List attributes
select-attribute <attribute/UUID>                 Select attribute
attribute-info [attribute/UUID]                   Select attribute
read [offset]                                     Read attribute value
write <data=xx xx ...> [offset]                   Write attribute value
acquire-write                                     Acquire Write file descriptor
release-write                                     Release Write file descriptor
acquire-notify                                    Acquire Notify file descriptor
release-notify                                    Release Notify file descriptor
notify <on/off>                                   Notify attribute value
register-application [UUID ...]                   Register profile to connect
unregister-application                            Unregister profile
register-service <UUID>                           Register application service.
unregister-service <UUID/object>                  Unregister application service
register-includes <UUID>                          Register as Included service in.
unregister-includes <Service-UUID><Inc-UUID>      Unregister Included service.
register-characteristic <UUID> <Flags=read,write,notify...>  Register application characteristic
unregister-characteristic <UUID/object>           Unregister application characteristic
register-descriptor <UUID> <Flags=read,write...>  Register application descriptor
unregister-descriptor <UUID/object>               Unregister application descriptor
back                                              Return to main menu
version                                           Display version
quit                                              Quit program
exit                                              Quit program
help                                              Display help about this program
export                                            Print evironment variables

'Linux > Linux 일반' 카테고리의 다른 글

RabbitMQ 설치 테스트 해보기  (0) 2020.11.26
raspberry pi bluetoothctl 사용하기 (블루투스)  (0) 2020.11.20
ubuntu mkimage, adb, fastboot 설치  (0) 2020.02.27
pulseaudio asyncdevicelist  (0) 2019.11.29
Posted by Real_G

댓글을 달아 주세요