Re: Folder Browsing on a BT phone
Do this to get the connection ID (as well as something similat to get the other headers): CFDictionaryRef dictionary = OBEXGetHeaders( yourcommandresponsedataptr, yourcommandresponsedatalength ); Then get keys/values from that dictionary: if( dictionary ) { if( CFDictionaryGetCountOfKey( dictionary, kOBEXHeaderIDKeyConnectionID ) > 0 ) { CFDataRef theDataRef; theDataRef = (CFDataRef) CFDictionaryGetValue( dictionary, kOBEXHeaderIDKeyConnectionID ); if( theDataRef ) { CFDataGetBytes( theDataRef, CFRangeMake( 0, 4 ), (uint8_t*) &mConnectionID ); } } } So, for a type header, you would do: if( CFDictionaryGetCountOfKey( dictionaryRef, kOBEXHeaderIDKeyType ) > 0 ) { CFStringRef theStringRef = (CFStringRef) CFDictionaryGetValue( dictionaryRef, kOBEXHeaderIDKeyType ); if( theStringRef ) { // blah } } Hopefully that helps! Jason bubba@apple.com
Yes, I create a mutable dict. I also got the code to work and get the
connection to the device,
and get into the callback function.
Now, in order to get the Connection ID do I have to parse the header
returned in OBEXSessionEvent
or there is an easier way of doing it?
Thanks again.
Victor
On Thursday, July 10, 2003, at 12:02 PM, Bubba Giles wrote:
I don't recognize that status code; I can't find it anywhere either...
Are
you sure that is the right code? Also, are you creating a dictionary
first
before putting the header in it, like this:
dictionary = CFDictionaryCreateMutable( kCFAllocatorDefault, 1,
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks );
Your code doesn't include it, so I just wanted to make sure.
_______________________________________________
bluetooth-dev mailing list | bluetooth-dev@lists.apple.com
Help/Unsubscribe/Archives:
Do not post admin requests to the list. They will be ignored.
_______________________________________________ bluetooth-dev mailing list | bluetooth-dev@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/bluetooth-dev Do not post admin requests to the list. They will be ignored.
participants (1)
-
Bubba Giles