site_archiver@lists.apple.com Delivered-To: bluetooth-dev@lists.apple.com Thread-index: AcdwuaMK4dAgJdysEduODgARJHK4jA== Thread-topic: What encoding do strings in IOBluetoothSDPDataElement structures use? User-agent: Microsoft-Entourage/11.3.3.061214 On 27.3.2007 22:55 Uhr, "Joseph Kelly" <joeman@mac.com> 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 (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com