Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not getting Proximity UUID in this app #9

Open
Sandhiya-San opened this issue Jan 2, 2019 · 5 comments
Open

Not getting Proximity UUID in this app #9

Sandhiya-San opened this issue Jan 2, 2019 · 5 comments

Comments

@Sandhiya-San
Copy link

How to read the Proximity UUID from 16byte data to 32character UUID number?

@Sandhiya-San
Copy link
Author

I tried converting the data to string from "characteristics.value" it doesn't give the 32character proximity uuid, kindly pls help to get the Proximity UUID

@Pluto-Y
Copy link
Owner

Pluto-Y commented Jan 3, 2019

Can you post the log you got?

@Sandhiya-San
Copy link
Author

Thanks for considering.
characteristic Log :
<CBCharacteristic: 0x282d4ee20, UUID = 00031235-0100-0800-0008-05F9B34F0131, properties = 0xA, value = <61726c10 20000000 00000000 00000001>, notifying = NO>

I need to get: value = <61726c10 20000000 00000000 00000001>

when i try print(characteristic?.value)!)
log: 16 bytes

  • count : 16
    ▿ pointer : 0x0000000280973a10
    • pointerValue : 10747329040
      ▿ bytes : 16 elements
    • 0 : 97
    • 1 : 114
    • 2 : 108
    • 3 : 16
    • 4 : 32
    • 5 : 0
    • 6 : 0
    • 7 : 0
    • 8 : 0
    • 9 : 0
    • 10 : 0
    • 11 : 0
    • 12 : 0
    • 13 : 0
    • 14 : 0
    • 15 : 1

In the above log, characteristic?.value is of type Data, so i tried converting Data to String by below mentioned methods:

String(data: data, encoding: String.Encoding.utf8)
String(data: data, encoding: String.Encoding.utf8.rawValue)
String(data: data, encoding: NSUTF8StringEncoding)
String(bytes: data, encoding: String.Encoding.utf8)
and some more..
For all the above Data to String conversion i get log as : "arl\u{10} \0\0\0\0\0\0\0\0\0\0\u{01}"

is there any other way to convert?

@L3v3nt
Copy link

L3v3nt commented Jan 13, 2019

As I know proximity ID is only for ibeacons not for peripherals

@Sandhiya-San
Copy link
Author

As I know proximity ID is only for ibeacons not for peripherals
Yes its for iBeacons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants