0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rohm sensorMedalをbluetoothctlで使う

Posted at

これは?

Raspberry pi zero wでRohm sensorMedalを使ってみるために、
bluezに入っているbluetoothctlを使って接続テストをしてみた。
(bluezをコンパイルするためには、swapを一時的に2Gに増やす必要があった。)

$ sudo bluetoothctl
[NEW] Controller B8:27:EB:E2:DD:XX raspberrypi [default]

で、起動し、

[bluetooth] scan on
[NEW] Device FE:2C:5D:1E:01:38 ROHM RAW

[bluetooth] pair FE:2C:5D:1E:01:38
Attempting to pair with FE:2C:5D:1E:01:38
[bluetooth] connect FE:2C:5D:1E:01:38
Attempting to connect to FE:2C:5D:1E:01:38    

ちょっとまって、attribute 一覧をget。
その中から、notifyのフラグが付いているattributeを探す。

[FE:2C:5D:1E:01:38] attribute-info /org/bluez/hci0/dev_FE_2C_5D_1E_01_38/service0b00/char0b05
Characteristic - Vendor specific
UUID: 0179bbc3-0000-0100-8000-00805f9b34fb
Service: /org/bluez/hci0/dev_FE_2C_5D_1E_01_38/service0b00
Notifying: no
Flags: notify

このattributeがそれっぽいので、

[FE:2C:5D:1E:01:38] select-attribute /org/bluez/hci0/dev_FE_2C_5D_1E_01_38/service0b00/char0b05

[service0b00/char0b05] notify on

これで、データが流れてくる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?