Re: What encoding do strings in IOBluetoothSDPDataElement structures use?
Re: What encoding do strings in IOBluetoothSDPDataElement structures use?
- Subject: Re: What encoding do strings in IOBluetoothSDPDataElement structures use?
- From: Joseph Kelly <email@hidden>
- Date: Tue, 27 Mar 2007 13:55:20 -0700
I've never used IOBluetoothSDPDataElement directly, but it looks like
it has accessors for string, data, numbers, and arrays. If the value
is data, it might just be a block of arbitrary bytes. You can
introspect the actual type of thing which gets returned using
objective-C introspection: NSLog(@"The element class:%@, it's
description is: %@", [elem className], [elem description]);
Hope that helps,
Joseph K.
On Mar 26, 2007, at 3:35 PM, Thomas Tempelmann wrote:
I wonder if it was smart to store byte sequences of SDP records as
NSStrings
only because the SDP specification calls them "strings".
The problem at hand is that I need to store non-textual strings in
the SDP
records but apparently can't: Apple's Bluetooth libs require me to
pass the
data in NSString containers, but those are for text, and need a
encoding,
which is basically nonsense, it appears to me.
I am trying to store a sequence of bytes into an NSString, but when
I try to
store it as a UTF8 string, the [NSString initFromData] call does
come back
with nil - apparently it does not like the data I passed as it's
not valid
UTF8. So what can I do? I cannot find a "binary data" encoding. And
when I
use some other encoding, then I might have to risk that when
generating the
actual SDP data that gets passed to other devices, it gets
converted into a
different encoding, altering my original data.
How can this be solved?
Thomas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden