Cov txheej txheem:

Nyeem Qhov Muaj Nqes Los Ntawm BLE Ntaus Siv CSR1010 thiab Dragonboard 410c: 6 Kauj Ruam
Nyeem Qhov Muaj Nqes Los Ntawm BLE Ntaus Siv CSR1010 thiab Dragonboard 410c: 6 Kauj Ruam

Video: Nyeem Qhov Muaj Nqes Los Ntawm BLE Ntaus Siv CSR1010 thiab Dragonboard 410c: 6 Kauj Ruam

Video: Nyeem Qhov Muaj Nqes Los Ntawm BLE Ntaus Siv CSR1010 thiab Dragonboard 410c: 6 Kauj Ruam
Video: Tshuaj theem vim li cas thiaj tau nqi ?/ Siv kho mob dab tsi?/paris polyphylla использовать для? 2024, Hlis ntuj nqeg
Anonim
Nyeem Qhov Muaj Nqes Los Ntawm BLE Ntaus Siv CSR1010 thiab Dragonboard 410c
Nyeem Qhov Muaj Nqes Los Ntawm BLE Ntaus Siv CSR1010 thiab Dragonboard 410c

Cov ntawv qhia no qhia yuav ua li cas nyeem qhov tseem ceeb los ntawm BLE ntaus ntawv CSR1010 siv Dragonboard 410c nrog Linaro

Hauv qhov piv txwv no, CSR1010 tab tom ua raws lub plawv dhia ntsuas.

Kauj Ruam 1: Luam theej duab BLE

Hauv theem no, txheeb xyuas yog tias koj tus neeg siv BT tau npaj rau kev tshuaj xyuas BLE cov cuab yeej.

hauv paus@linaro-alip:/home/linaro# sudo hcitool lescan

LE Scan… 18: EE: 69: 00: CE: 00 (tsis paub) 18: EE: 69: 00: CE: 00 (tsis paub) EE: 52: 5B: 04: 00: 02 CSR HR Sensor

Kauj Ruam 2: Txuas Tus Ntaus

Peb yuav siv gatttool los txuas peb lub cuab yeej

-b: Ntaus MAC chaw nyob

-t: LE chaw nyob. Yuav yog pej xeem lossis tsis raug, xav tau txheeb xyuas cov cuab yeej tshwj xeeb. Hauv qhov no yog pej xeem.

-I: gatttool sib tham sib hom. Nws yuav qhib qhov sai kom xa cmds rau lub cuab yeej

hauv paus@linaro -alip:/home/linaro# sudo gatttool -b EE: 52: 5B: 04: 00: 02 -t pej xeem -I

Thaum qhov kev thov qhib, peb tuaj yeem xa txuas cmd rau lub cuab yeej.

[EE: 52: 5B: 04: 00: 02] [LE]> txuas Txuas mus txuas rau EE: 52: 5B: 04: 00: 02

Kev sib txuas tau zoo

[EE: 52: 5B: 04: 00: 02] [LE]>

Kauj Ruam 3: Rov Nrhiav Cov Ntaus Ntaus

Rov Nrhiav Cov Cuab Yeej Cuab Yeej
Rov Nrhiav Cov Cuab Yeej Cuab Yeej

Thaum lub cuab yeej txuas nrog, peb tuaj yeem nyeem txhua qhov kev pabcuam muaj los ntawm kev xa cmd "thawj"

Raws li kev pabcuam UUID, peb tuaj yeem tshawb pom hom kev pabcuam hauv GATT qhov tshwj xeeb

www.bluetooth.com/specifications/gatt/services

Kauj Ruam 4: Nyeem Ntawv Ntaus Npe

Nyeem Ntawv Ntaus Npe
Nyeem Ntawv Ntaus Npe

Cia peb tshawb xyuas cov yam ntxwv nyeem ntawm Cov Ntawv Nkag Nkag Nkag (Generic Access Profile) (uuid = 1800). Ua ntej peb yuav tsum tau txais qhov kev pabcuam saib xyuas qhov muaj txiaj ntsig, piav qhia hauv daim duab thawj, hauv qhov no, pib txij 5 txog 11. Tam sim no peb tuaj yeem khaws tag nrho cov haujlwm hauv lub sijhawm no los ntawm kev siv cmd char-desc

[EE: 52: 5B: 04: 00: 02] [LE]> char-desc 05 11handle: 0x0005, uuid: 00002800-0000-1000-8000-00805f9b34fb tuav: 0x0006, uuid: 00002803-0000-1000-8000- 00805f9b34fb tuav: 0x0007, uuid: 00002a00-0000-1000-8000-00805f9b34fb tuav: 0x0008, uuid: 00002803-0000-1000-8000-00805f9b34fb tuav: 0x0009, uuid: 00002a01-0000-1000-8000-00805 uuid: 00002803-0000-1000-8000-00805f9b34fb tuav: 0x000b, uuid: 00002a04-0000-1000-8000-00805f9b34fb tuav: 0x000c, uuid: 00002800-0000-1000-8000-00805f9b34fb tuav: 0x000d, uu80 -1000-8000-00805f9b34fb tuav: 0x000e, uuid: 00002a37-0000-1000-8000-00805f9b34fb tuav: 0x000f, uuid: 00002902-0000-1000-8000-00805f9b34fb tuav: 0x0010, uuid: 00002803-0000-1000-800-000 00805f9b34fb tuav: 0x0011, uuid: 00002a38-0000-1000-8000-00805f9b34fb

Raws li Kev Nkag Mus Nkag Nkag Nkag Nkag Nkag Tshwj Xeeb Tshwj Xeeb, UUID 2A00 hais txog Ntaus Npe.

Xav tias 2a00 yog tus tuav 0x0007 hauv peb lub cuab yeej, cia peb nyeem tus nqi

[EE: 52: 5B: 04: 00: 02] [LE]> char-read-hnd 7Characteristic value/descriptor: 43 53 52 20 48 52 20 53 65 6e 73 6f 72

Hloov hex rau ASCII, lub cuab yeej lub npe yog: '' CSR HR Sensor"

Kauj Ruam 5: Nyeem BPM

[EE: 52: 5B: 04: 00: 02] [LE]> thawj tus tuav: 0x0001, kawg tuav tuav: 0x0004 uuid: 00001801-0000-1000-8000-00805f9b34fb tus tuav tuav: 0x0005, kawg tuav tuav: 0x000b uuid: 00001800-0000-1000-8000-00805f9b34fb attr tuav: 0x000c, kawg grp tuav: 0x0013 uuid: 0000180d-0000-1000-8000-00805f9b34fb attr tuav: 0x0014, kawg grp tuav: 0x0017 uuid: 0000180f-0000-1000-8000- 00805f9b34fb attr tuav: 0x0018, kawg grp tuav: 0x0021 uuid: 00001016-d102-11e1-9b23-00025b00a5a5 attr tuav: 0x0022, kawg tuav tuav: 0xffff uuid: 0000180a-0000-1000-8000-00805f9b34fb

Qhov Kev Pabcuam Lub Plawv UUID yog 0x180d, yog li tswj lub sijhawm yog los ntawm 0x000c txog 0x0013

[EE: 52: 5B: 04: 00: 02] [LE]> char-desc 0x00c 0x0013

tuav: 0x000c, uuid: 00002800-0000-1000-8000-00805f9b34fb kov: 0x000d, uuid: 00002803-0000-1000-8000-00805f9b34fb kov: 0x000e, uuid: 00002a37-0000-1000-8000-00805f9b34fb tuav: 0x000e,: 00002902-0000-1000-8000-00805f9b34fb kov: 0x0010, uuid: 00002803-0000-1000-8000-00805f9b34fb kov: 0x0011, uuid: 00002a38-0000-1000-8000-00805f9b34fb tuav: 0x0012, uuid: 0000280 1000-8000-00805f9b34fb tuav: 0x0013, uuid: 00002a39-0000-1000-8000-00805f9b34fb

Nyeem tag nrho Cov Yam Ntxim Saib Ntxim Ua Tshaj Tawm (UUID 0x2803).

[EE: 52: 5B: 04: 00: 02] [LE]> char-read-hnd 0x000d

Tus yam ntxwv tus nqi/piav qhia: 10 0e 00 37 2a [EE: 52: 5B: 04: 00: 02] [LE]> char-read-hnd 0x0010 Tus yam ntxwv tus nqi/piav qhia: 02 11 00 38 2a [EE: 52: 5B: 04:00:02] [LE]> char-read-hnd 0x0012 Tus yam ntxwv tus nqi/piav qhia: 08 13 00 39 2a

Ceeb toom tias:

- tuav 0x000d yog CCCD rau kev pabcuam 2a37 (Kev Ntsuas Lub Plawv) nrog me ntsis 10 (txhawb nqa ceeb toom)

- tuav 0x0010 yog CCCD rau kev pabcuam 2a38 (Lub Cev Lub Cev Qhov Chaw) nrog me ntsis 02 (txhawb nqa Nyeem)

- tuav 0x0012 yog CCCD rau kev pabcuam 2a39 (Lub Plawv Tswj Tus Kheej) nrog me ntsis 08 (txhawb nqa WRITE)

Tam sim no peb paub tias Kev Ntsuas Tus Kheej Lub Plawv tsuas ua haujlwm nrog ceeb toom. Nws txhais tau tias ua ntej peb yuav tsum sau npe rau tus nqi hloov pauv hauv nws CCCD (UUID 0x2902), uas hauv qhov no yog ua haujlwm 0xf

[EE: 52: 5B: 04: 00: 02] [LE]> char-sau-req 0x00f 0100

Kev ceeb toom tuav = 0x000e tus nqi: 16 65 f3 01 Tus yam ntxwv tus nqi tau sau tiav Kev ceeb toom tuav = 0x000e tus nqi: 16 6d fa 01 Kev ceeb toom tuav = 0x000e tus nqi: 16 6d fa 01 Kev ceeb toom tuav = 0x000e tus nqi: 16 6c f9 01 Kev ceeb toom tuav = 0x000e tus nqi: 16 6a f7 01 Kev ceeb toom tuav = 0x000e tus nqi: 16 69 f6 01

Raws li cov lus qhia tshwj xeeb, tus lej hex thib ob yog BPM cov ntaub ntawv.

BPM:

6d109 ua

6d109 ua

6c = 108 ib

6 ua = 106

69 = 105

Kauj Ruam 6: Nyeem Lub Cev Lub Cev Qhov Chaw

Nyeem Ntawv Lub Cev Sensor Qhov Chaw
Nyeem Ntawv Lub Cev Sensor Qhov Chaw

Lub Cev Lub Cev Sensor Qhov Chaw yog UUID 0x2A38. Raws li nws cov lus piav qhia, tus yam ntxwv no txhawb kev nyeem yooj yim, yog li peb tuaj yeem nyeem nws tus nqi ncaj qha.

[EE: 52: 5B: 04: 00: 02] [LE]> char-read-hnd 0x11Characteristic value/piav qhia: 03

Raws li SIG qhov tshwj xeeb, 03 txhais tau tias "Ntiv tes"

Pom zoo: