OBEX Documentation

Introduction

This is the documentation OBEX client.

Author:
Antti Maatta
Version:
6
Date:
13.05.2007

Changelog

 VERSION    DATE            AUTHOR              DESCRIPTION
 6          13.05.2007      Antti Maatta        Experiments with OBEX authentication. No results. Flags to obexOpenSession.
 5          11.04.2007      Antti Maatta        Fixed mis-spelled response code constants, obexUtilSetPath return value, 
                                                added SYNC service GUIDS, Warning level 3 no warnings, use secure versions of some functions.
 4          05.04.2007      Antti Maatta        Timeout sets Session to disconnected state
 3          20.03.2007      Antti Maatta        First somewhat usable version.  
 2          02.03.2007      Antti Maatta        Added new packet management functions.    
 1          20.02.2007      Antti Maatta        Initial draft.     

Notes

All UNICODE strings are in UTF-16 format.
According to Object Push Profile Specifications the connection target header must not be used with OPP.

Examples

Sending a file to remote device using FTP.
  int sendFile(wchar_t* localFilename, wchar_t* remoteFileName, char* contentType, BluetoothAddress* remoteAddress )
  {
    BTConnection*               connection  = NULL;
    ObexPacket*                 request     = NULL;
    ObexPacket*                 response    = NULL;
    ObexSession*                session     = NULL;

    int             ret;
    OBEX_UUID       serviceFtp  = SERVICE_OBEX_FTP;
    OBEX_UUID       serviceObex = SERVICE_OBEX;

    // create bluetooth connection to the remote device
    if ( (ret = createBTConnection( &connection, NULL, remoteAddress, &serviceObex, 0 )) != OBEX_ERROR_SUCCESS )
    {
        return ret;
    }

    // open obex ftp session to obex server
    if ( (ret = obexSessionOpen( &session, connection, NULL, NULL, &serviceFtp, NULL, NULL )) != OBEX_ERROR_SUCCESS )
    {
        ret = closeBTConnection(connection);
        return ret;
    }

    // push the file to server 
    ret = obexUtilPushFromFile( session, localFilename, remoteFileName, contentType );

    obexSessionClose(session);
    closeBTConnection(connection);
    return 0;
  }
footer
 SourceForge.net Logo