2016-06-17 5 views
1

私はBluetoothデバイスと通信するのにbluepy libraryを使用していますが、私にはすべての特性が示されていません。Bluetooth Bluepyがすべての特性を見つけられません

私は私が手に、次の使用gatttool実行します。

[EE:50:F0:F8:3C:FF][LE]> char-desc 0x0019 0xffff 
handle: 0x0019, uuid: 00002800-0000-1000-8000-00805f9b34fb 
handle: 0x001a, uuid: 00002803-0000-1000-8000-00805f9b34fb 
handle: 0x001b, uuid: 00001532-1212-efde-1523-785feabcd123 
handle: 0x001c, uuid: 00002803-0000-1000-8000-00805f9b34fb 
handle: 0x001d, uuid: 00001531-1212-efde-1523-785feabcd123 
handle: 0x001e, uuid: 00002902-0000-1000-8000-00805f9b34fb 
handle: 0x001f, uuid: 00002803-0000-1000-8000-00805f9b34fb 
handle: 0x0020, uuid: 00001534-1212-efde-1523-785feabcd123 

をしかし、私はBluepyを使用して、以下を実行したときに私が手:

characteristics = self.peripheral.getCharacteristics(startHnd=0x0019, endHnd=0xFFFF, uuid=None) 
for characteristic in characteristics: 
    print("{}, hnd={}, supports {}".format(characteristic, hex(characteristic.handle), characteristic.propertiesToString())) 

Characteristic <00001532-1212-efde-1523-785feabcd123>, hnd=0x1a, supports WRITE NO RESPONSE 
Characteristic <00001531-1212-efde-1523-785feabcd123>, hnd=0x1c, supports NOTIFY WRITE 
Characteristic <00001534-1212-efde-1523-785feabcd123>, hnd=0x1f, supports READ 

私は書くことができるようにする必要があります「\ X01 \ X00' :\ X01 \ X04 '特性に特性に

handle: 0x001e, uuid: 00002902-0000-1000-8000-00805f9b34fb 

書き込みが続く':

handle: 0x001d, uuid: 00001531-1212-efde-1523-785feabcd123 

しかしBluepy特性を見つけていないので、私はすることができません:

handle: 0x001e, uuid: 00002902-0000-1000-8000-00805f9b34fb 

これはなぜでしょうか?

Bluepyが見つからない場合、どのように特性に書き込むことができますか?

なぜBluepyによって返されたハンドルがgatttoolによって返されたハンドルと一致しないのですか?

ありがとうございました

答えて

0

これらの追加的な特性については間違いがあります。 000028xxで始まるuuidsは、ここに示すように特徴的な "宣言"です。gatt declaration spec000029xxで始まるuuidsは、ここに示すような記述子です。gatt descriptor spec。それらは特性そのものではなく、特性の1つに関する詳細を記述します。

関連する問題