• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OBEXSession functionality Problems!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OBEXSession functionality Problems!


  • Subject: Re: OBEXSession functionality Problems!
  • From: "Arun Kumar" <email@hidden>
  • Date: Wed, 5 Dec 2007 16:21:13 +0530

Hi Mat/Bubba,

I am writing the callback function as below

void handleSessionEvent(const OBEXSessionEvent *event)  
{      
   switch (event->type)  
   {  
       case (kOBEXSessionEventTypeConnectCommandResponseReceived):  
printf("Connect Event Type\n"); 
            break;               

       case (kOBEXSessionEventTypeDisconnectCommandResponseReceived):  
              printf("Disconnect Event Type\n");
              break;

       case (kOBEXSessionEventTypeError): 
              printf("Error Event Type");
              break;
 
       default:  
              prinf("In default session\n");
             break;  
   }  
}  



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).

Thanks,
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
>

 _______________________________________________
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

  • Follow-Ups:
    • Re: OBEXSession functionality Problems!
      • From: "Arun Kumar" <email@hidden>
References: 
 >OBEXSession functionality Problems! (From: "Arun Kumar" <email@hidden>)
 >Re: OBEXSession functionality Problems! (From: mat davidson <email@hidden>)

  • Prev by Date: Re: OBEXSession functionality Problems!
  • Next by Date: Skeleton driver Bluetooth ?
  • Previous by thread: Re: OBEXSession functionality Problems!
  • Next by thread: Re: OBEXSession functionality Problems!
  • Index(es):
    • Date
    • Thread