OpenOBEX shared library programming guide

Pontus Fuchs

      
     

Christian Zuckschwerdt

      
     

This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA


Table of Contents
1. Introduction
2. Programming the library
2.1. Preparations
2.2. The event callback
2.3. Client Operations
2.4. Server Operations
3. API Reference
OBEX_Init --  Initialize OBEX.
OBEX_RegisterCTransport --  Register a custom transport
OBEX_Cleanup --  Close down an OBEX instance
OBEX_SetUserData --  Set userdata of an OBEX handle
OBEX_GetUserData --  Read the userdata from an OBEX handle
OBEX_SetUserCallBack --  Change user callback on an OBEX handle
OBEX_SetTransportMTU --  Set MTU to be used for receive and transmit
OBEX_ServerRegister --  Start listening for incoming connections
OBEX_ServerAccept --  Accept an incoming connection
OBEX_HandleInput --  Let the OBEX parser do some work
OBEX_CustomDataFeed --  Feed OBEX with data when using a custom transport
OBEX_TransportConnect --  Try to connect to peer
OBEX_TransportDisconnect --  Disconnect transport
OBEX_GetFD --  Get FD
OBEX_Request --  Start a request (as client)
OBEX_CancelRequest --  Cancel an ongoing operation
OBEX_SuspendRequest --  Suspend transfer of an object
OBEX_ResumeRequest --  Resume transfer of an object
OBEX_ObjectNew --  Create a new OBEX Object
OBEX_ObjectDelete --  Delete an OBEX object
OBEX_ObjectAddHeader --  Attach a header to an object
OBEX_ObjectGetNextHeader --  Get next available header from an object
OBEX_ObjectReParseHeaders --  Allow the user to parse again the rx headers
OBEX_ObjectReadStream --  Read data from body stream
OBEX_ObjectSetRsp --  Sets the response to a received request.
OBEX_ObjectGetNonHdrData --  Get any data which was before headers
OBEX_ObjectSetNonHdrData --  Set data to send before headers
OBEX_ObjectSetHdrOffset --  Set headeroffset
OBEX_UnicodeToChar --  Simple unicode to char function.
OBEX_CharToUnicode --  Simple char to unicode function.
OBEX_ResponseToString --  Return a human understandable string from a response-code.
OBEX_GetResponseMessage --  Return a human understandable string from a response-code.
OBEX_SetCustomData --  Set customdata of an OBEX handle
OBEX_GetCustomData --  Read the customdata from an OBEX handle
InOBEX_ServerRegister --  Start listening for incoming connections
InOBEX_TransportConnect --  Connect Inet transport
IrOBEX_ServerRegister --  Start listening for incoming connections
IrOBEX_TransportConnect --  Connect Irda transport
BtOBEX_ServerRegister --  Start listening for incoming connections
BtOBEX_TransportConnect --  Connect Bluetooth transport
OBEX_InterfaceConnect --  Connect USB interface
OBEX_FindInterfaces --  Get a list of OBEX interfaces on the system
OBEX_FreeInterfaces --  free memory allocated to OBEX interface structures
List of Tables
2-1. Arguments
List of Examples
2-1. OBEX Put example
2-2. Event callback of a typical server