来自fetchUuidsWithSdp的奇怪UUID逆转 [英] Strange UUID reversal from fetchUuidsWithSdp

查看:125
本文介绍了来自fetchUuidsWithSdp的奇怪UUID逆转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在树莓派上运行的python蓝牙服务器(使用PyBluez).我在服务器中使用的uuid是:

I have a python bluetooth server (using PyBluez) running on a raspberry pi. The uuid I use in the server is:

8f86d132-4ab8-4c15-b8df-0b70cf10ea56

我正在呼叫 device.fetchUuidsWithSdp() 我的Android应用中的蓝牙服务器.当它最终获取uuid时,它们已经以两个为一组的顺序反转了(看来字节序已更改).

I am calling device.fetchUuidsWithSdp() on the bluetooth server in my Android app. When it eventually fetches the uuids, they have been reversed in groups of two (it seems the endianness has changed).

在广播接收器中:

Parcelable[] uuids = intent.getParcelableArrayExtra(BluetoothDevice.EXTRA_UUID);
if (uuids != null) {
    if (uuids.length > 0) {
         for (Parcelable uuid : uuids) {
              Utilities.err(uuid.toString());
         }
    } else {
         Utilities.err("no uuids");
    }
} 

例如:

8f86d132-4ab8-4c15-b8df-0b70cf10ea56-> 56ea10cf-700b-dfb8-154c-b84a32d1868f

看看前两个字符8f,它们是反向uuid的后两个字符.

look at the first two characters 8f, they are the last two characters of the reversed uuid.

看看后两个字符86,它们是反向uuid的倒数第二个字符

look at the second two characters 86, they are the second last two characters of the reversed uuid

是什么原因造成的?

这与UUID是小的还是大的字节序有什么关系?

Does this have anything do to with the UUID being little or big-endian?

推荐答案

您是否有机会在Android 6.0.1版上遇到此问题? 遗憾的是,这似乎是android中的错误导致的. https://code.google.com/p/android/issues/detail ?id = 197341

are you by any chance experiencing this on android version 6.0.1? sadly there seems to be a bug in android causing this. https://code.google.com/p/android/issues/detail?id=197341

这篇关于来自fetchUuidsWithSdp的奇怪UUID逆转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆