1. OBEX Client: The connection is initiated by the Obex client to the OBEX server. The following command can be used to establish and release this connection. Connect method: Create a connection to the server side by the client on the OBEX layer. Before this, you can call the IOBEX :: EnumDevices method to get pointers to the OBEX server device. Each device provides an interface interface to the outside. If this device does not provide an OBEX service, the Connect request to the device will fail. The user can not see the details of the transmission, only Name and Address are visible. Disconnect method: Release the connection of the customer and the server and the accounts occupied. When a connection is successfully established, the user can use the following method: PUT method: Send data from the server. Get method: If the server provides this method, you can get data from the server. ABORT method: Interrupt PUT and GET methods. SETPATH Method: Set the current path to the server and create a path on the server. Below is an example of using several methods. See MSDN. Connecting to an OBEX Server Disconnecting from an OBEX Server Requesting a Data Object from the OBEX Server Sending a Data Object to the OBEX Server Aborting a Request Setting the Target Folder Path on the OBEX Server See Also Device Discovery Object Exchange Interfaces Connection Points Use of Streams Object Exchange Protocol 1.1Device Discovery Device Discovery Device Discovery allows the client to discover other ObEX services within the range, call the IOBEX :: EnumDevices method to get a list of these devices. There is also a method to apply IconnectionPointContainer and IOBEXSINK. Then receive the notification of the device discovery in IOBEXSINK. The specific practices are as follows: IOBEX-> QueryInterface query gets the pointer to the iconnectionPointContainer (PCPContainer). pCPContainer-> FindConnectionPoint (& pCP) IObexSink pSink; pCP-> Advise (pSink) IObexSink pObex-> StartDeviceEnum code is as follows:! IObex * m_pObex; CObexSink m_ObexSink; IConnectionPointContainer * m_pCont; IConnectionPoint * m_pConPt; DWORD m_dwConnectCookie; if (SUCCEEDED (m_pObex- > QueryInterface (IID_IConnectionPointContainer, (LPVOID *) & m_pCont))) return FALSE; if ((SUCCEEDED (m_pCont-> FindConnectionPoint (IID_IObexSink, & m_pConPt)!))) return FALSE;! if ((SUCCEEDED (m_pConPt-> Advise ((IUnknown *) (& m_obexsink)
Heavy written NOTIFY (Obex_Event Event, IUNKNOWN * PUNK1, IUNKNOWN * PUNK2) in COBEXSINK. The ability of Device Capability device: The device capability is a prompt for the service provided by the OBEX server. When the OBEX server is discovered by the client, the transport layer assembles the marker of the service provided to the byte domain. The client can then determine which services have provided by the client according to these flags. These markers do not mean that the server provides these services, this is just a prompt. To verify the service, the client wants to send a connection request to the server side if the server is not allowed to provide the service, and the connection will fail. Understand the following services: Push, File Browsing, Synchronization. For infrared devices, the connecting lines are connected. For Bluetooth devices, an identifier of the remote server is prompted. 1.2 Object Exchange Interfaces Object Exchange Interface Object Exchange Interface allows applications to exchange data through the OBEX service protocol. Wince provides support for Obex, where you can run multiple OBEX servers on both paired devices. 1.3Connection Points Connection point OBEX supports user notification of connection points. The connection point uses the standard COM method to define a callback function on the object. Server and clients typically do not call callback functions so that the message will not be received when the connection request and connection are released. Server and clients have completed callbacks through this method. 1.4 The Use of Streams Obex function presses these data to an object when sending and receiving the Obex head Body and Endofbody headers. The Body section is an ISTREAM interface through a modular COM. When the file is transferred, call the OpenStreamonfile function to get the Stream interface of this file. Then you can use COPY stream to get from Obexapi. Send data, you can call the read and write methods of Istream. In most cases, the OBEX layer presses the data to the body and endofbody headers. 1.5 Connecting to an Obex Server Connect request is optional. If you do not call Connect before calling CONNECT, you will send a 255-byte packet. Connext: Call the IOBEXDEVICE :: Connect () server and then respond to a property package. The length of the transmitted packet depends on the number and size of the requested header included. You can use a Target header when sending a Connect request to specify a service. If you don't specify, you are inbox service.