when I run the project my handleSessionEvent callback function is not called. Maybe I have written this in wrong way.
Can u guy help me how to write this callback function(in C/C++ not Obj C).
Arun Kumar.
On Dec 4, 2007 11:41 PM, mat davidson <
email@hidden> wrote:
>
> Arun-
>
> The OBEX APIs (actually almost all of our Bluetooth APIs) are
> asynchronous, meaning you'll need to wait to be called back on the
> callback function you've provided (handleSessionEvent). That will
> return the result of the SessionConnect command. The return value
> you're looking at from OBEXSessionConnect is just telling you that the
> initial stuff looks good, not that the Connect command has completed
> or has been successful. Once you get a result returned to you in the
> callback method you can move forward with the HasOpen() functions and
> the like.
>
> Best.
>
> - mat
>
>
>
> On Dec 4, 2007, at 4:12 AM, Arun Kumar wrote:
>
>
>
>
> > Hi All,
> >
> > I have to send the file from Mac system to device using FTP for that
> > i am trying to connect the session by using OBEXSessionConnect
> > function.
> >
> > The problem is now if i try to use OBEXSessionHasOpenOBEXConnection
> > after connect function(which return kOBEXSuccess), it returns
> > false(that means session has no open connection)
> >
> > And if i try to disconnect the session after connect by using
> > OBEXSessionDisconnect, it return error.
> >
> > As I continue my RnD on OBEXSession functionality, I came to know if
> > i give some wrong information like header ref. to OBEXSessionConnect
> > function, it still return kOBEXSuccess.
> >
> > Please help me, i can't undersatnd why it is happening.
> >
> > Here is code that I use:
> >
> > uint8_t targetUUID[] = { 0xF9, 0xEC, 0x7B , 0xC4, 0x95, 0x3C, 0x11,
> > 0xD2, 0x98, 0x4E, 0x52, 0x54, 0x00, 0xDC, 0x9E, 0x09 };
> >
> > OBEXAddTargetHeader( targetUUID, sizeof( targetUUID ), dictionary );
> > getHeadersDataRef = OBEXHeadersToBytes( dictionary );
> >
> > error = OBEXSessionConnect( obexSessionRef,kOBEXConnectFlagNone, //
> > connect flags
> > 256, // max packet size
> > (void*) CFDataGetBytePtr( aGetHeadersDataRef ), // headers
> > CFDataGetLength( aGetHeadersDataRef ), // header size
> > handleSessionEvent, // callback
> > NULL ); // refcon
> >
> > Boolean isConnected = FALSE;
> > error = OBEXSessionHasOpenOBEXConnection(
> > obexSessionRef,&isConnected );
> > if(error)
> > printf("Error in OBEXSessionHasOpenOBEXConnection\n" );
> >
> > if( isConnected)
> > printf("There is Connection between Computer & device\n" );
> > else
> > printf("Computer is not connected with device\n" );
> >
> >
> > error = OBEXSessionDisconnect( obexSessionRef,
> > (void*) CFDataGetBytePtr( aGetHeadersDataRef ), // headers
> > CFDataGetLength( aGetHeadersDataRef ), // header size
> > ConnectedCallback, // callback
> > NULL ); // refcon
> >
> > if(error)
> > printf("Error in OBEXSessionDisconnect\n" );
> >
> >
> >
> >
> > Thanks in advance,
> > Arun Kumar.
>
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> Do not post admin requests to the list. They will be ignored.
> Bluetooth-dev mailing list (
email@hidden)
> Help/Unsubscribe/Update your Subscription:
email@hidden
>