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"
);
Arun Kumar.