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: Thomas Tempelmann <email@hidden>
- Date: Tue, 27 Mar 2007 23:48:21 +0200
- Thread-topic: What encoding do strings in IOBluetoothSDPDataElement structures use?
On 27.3.2007 22:55 Uhr, "Joseph Kelly" <email@hidden> wrote:
> 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]);
I guess I have not been clear enough.
What you suggest is exactly how I introspect the SDP records and how I also
try to insert my binary string data.
And I came to the conclusion that it's simply a design flaw - the SDP
"string" data type should have been implemented as a NSData type on the Mac,
not as a NSString type - with the current NSString type, it appears to be
impossible to insert binary data into the SDP record. I tried to store a
copy of what a Apple Bluetooth Mouse stores in there, and it's not possible
- depending on the Encodings I tried (when putting a sequence of bytes into
a NSString, you have to provide an encoding), the NSString either rejects
the bytes or creates an internal representation that doesn't come out right
again.
Ergo: It's currently impossible to create a HID service on the Mac.
I'll file a bug report tomorrow.
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