📄 obexbinding.h
字号:
* IN: privateServiceInfo, pointer to the transport binding's private * information about the service instance. This is the same value * that was returned by the "selectProtocol" function when the * service instance was created. */Ret_t XPTAPI obxDeselectProtocol( void *privateServiceInfo );/** * FUNCTION: Called when xptOpenCommunication() is called, creating a * connection instance. * * Create a connection instance for the given service id. * * IN: privateServiceInfo, pointer to the transport binding's private * information about the service instance. This is the same value * that was returned by the "selectProtocol" function when the * service instance was created. * * role, passed directly from the xptOpenCommunication() call. * * OUT: *pPrivateConnectionInfo, pointer to the transport binding's private * information for the newly allocated connection instance. This * pointer will be passed on subsequent calls to the transport's * functions to identify this connection instance to the transport. */Ret_t XPTAPI obxOpenCommunication( void *privateServiceInfo, int role, void **pPrivateConnectionInfo );/** * FUNCTION: Called when xptCloseCommunication() is called, closing a * connection instance. * * Close a connection instance. * * IN: privateConnectionInfo, pointer to the transport binding's private * information about the connection instance. This is the same * value that was returned by the "openCommunication" function when * the connection instance was created. */Ret_t XPTAPI obxCloseCommunication( void *privateConnectionInfo );/** * FUNCTION: Called when xptBeginExchange() is called * * Prepare for a document exchange. * * IN: privateConnectionInfo, pointer to the transport binding's private * information about the connection instance. This is the same * value that was returned by the "openCommunication" function when * the connection instance was created. */Ret_t XPTAPI obxBeginExchange(void *privateConnectionInfo);/** * FUNCTION: Called when xptEndExchange() is called * * Clean up after a document exchange. * * IN: privateConnectionInfo, pointer to the transport binding's private * information about the connection instance. This is the same * value that was returned by the "openCommunication" function when * the connection instance was created. */Ret_t XPTAPI obxEndExchange(void *privateConnectionInfo);/** * FUNCTION: Called when xptReceiveData() is called * * Read data * * IN: privateConnectionInfo, pointer to the transport binding's private * information about the connection instance. This is the same * value that was returned by the "openCommunication" function when * the connection instance was created. * * buffer, passed directly from the xptReceiveData() call. * * bufferLen, passed directly from the xptReceiveData() call. * * OUT: * dataLen, passed directly from the xptReceiveData() call. */Ret_t XPTAPI obxReceiveData(void *privateConnectionInfo, void *buffer, size_t bufferLen, size_t *dataLen);/** * FUNCTION: Called when xptSendData() is called * * Send data * * IN: privateConnectionInfo, pointer to the transport binding's private * information about the connection instance. This is the same * value that was returned by the "openCommunication" function when * the connection instance was created. * * buffer, passed directly from the xptSendData() call. * * bufferLen, passed directly from the xptSendData() call. * * lastBlock, passed directly from the xptSendData() call. */Ret_t XPTAPI obxSendData(void *privateConnectionInfo, const void *buffer, size_t bufferLen, size_t *bytesSent);/** * FUNCTION: Called when xptSendData() is called by the application, after * sending the last byte of the document. * * Complete send processing for an outgoing document. * * IN: privateConnectionInfo, pointer to the transport binding's private * information about the connection instance. This is the same * value that was returned by the "openCommunication" function when * the connection instance was created. * * NOTES: * * The xpt interface layer counts the number of bytes the application * writes using the xptSendData() function. When the transport * implementation has written the last byte of the document, the xpt * interface layer calls this function in the transport implementation to * allow it to perform any desired completion processing. The length of * the document is known because it was specified by the application in the * xptSetDocumentInfo() call. * * Any error returned from sendComplete() is returned to the application * as the result value of the application's call to xptSendData(). * * Note that this function call does NOT correspond to an xptSendComplete() * function call available to the application. Instead, it is called * automatically by the xpt interface layer when the application has * successfully written the last byte of the document. */Ret_t XPTAPI obxSendComplete(void *privateConnectionInfo);/** * FUNCTION: Called when xptSetDocumentInfo() is called * * Provide document information for an outgoing document. * * IN: privateConnectionInfo, pointer to the transport binding's private * information about the connection instance. This is the same * value that was returned by the "openCommunication" function when * the connection instance was created. * * pDoc, passed directly from the xptSetDocumentInfo() call. */Ret_t XPTAPI obxSetDocumentInfo( void *privateConnectionInfo, const XptCommunicationInfo_t *pDoc );/** * FUNCTION: Called when xptGetDocumentInfo() is called * * Retrieve the document information associated with an incoming document. * * IN: privateConnectionInfo, pointer to the transport binding's private * information about the connection instance. This is the same * value that was returned by the "openCommunication" function when * the connection instance was created. * * pDoc, passed directly from the xptGetDocumentInfo() call. */Ret_t XPTAPI obxGetDocumentInfo( void *privateConnectionInfo, XptCommunicationInfo_t *pDoc );/*********************************************************************************//***************************** Private Functions *********************************//*********************************************************************************//*** Associate a connection to the passed service*/static Ret_t obxAddConnection( ObxServiceBlock *service, ObxConnectionBlock *connection );/*** Removes the connection from it's service object.** Any associated storage used to keep it in sequence within the service block** is free'ed but it's the callers responsibility to free the connection block itself.** Returns null if connection block is not found within service referenced by the connection.*/static ObxConnectionBlock * obxRemoveConnection( ObxConnectionBlock *connection );/*** Wacks all storage associated with the passed connection construct.** Note that it's up to the caller to ensure that the passed object has** been removed from any ObxServiceBlock's.*/static Ret_t obxFreeConnection( ObxConnectionBlock *connection );/*** Wacks all storage associated with the passed service construct.** Including the storage in the passed construct.*/static Ret_t obxFreeService( ObxServiceBlock *block );/*** Register the TCP Obex binding.*/static Ret_t obxRegisterTcpObex();/*** Register the IR Obex binding.*/static Ret_t obxRegisterIrObex();/*** Flow obex handshaking for client mode*/static Ret_t obxInitializeForClientMode( ObxConnectionBlock *cblock );/*** Flow obex handshaking for server mode*/static Ret_t obxInitializeForServerMode( ObxConnectionBlock *cblock );/*** Queue the inbound buffer for a later send.*/static Ret_t obxQueueBufferForSend( ObxConnectionBlock *connection, const void *buffer, size_t bufferLen );/*** Form a single buffer with all data to send.*/static int obxGetBufferForSend( ObxConnectionBlock *connection, ObxBuffer **body );/*** Register the underlying OBEX transporta*/static Ret_t obxRegisterTransport( ObxConnectionBlock *ocb );// static Ret_t obxWaitForDisconnect( ObxConnectionBlock *ocb );static Ret_t obxResetConnection( ObxConnectionBlock *ocb );static Ret_t obxSendObexConnect( ObxConnectionBlock *ocb );static Ret_t obxSendObexDisconnect( ObxConnectionBlock *ocb );static ObxObject *obxWaitForObexResponse( ObxConnectionBlock *ocb );/*** Record errors with xpt layer*/static void obxRecordError( long errorCode, ... );/** Parse the value string of the header field XSyncmlHmac*/static unsigned char *splitParmValue (unsigned char *pszLine, // i: line unsigned char **ppszParm, // o: ptr to extracted parameter unsigned char **ppszValue); // o: ptr to extracted parameter value#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -