libraries/btserial/inc/btserialclient.h
changeset 0 7f656887cf89
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // btserialclient.h
       
     2 // 
       
     3 // Copyright (c) 2008 - 2010 Accenture. All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of the "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 // 
       
     9 // Initial Contributors:
       
    10 // Accenture - Initial contribution
       
    11 //
       
    12 
       
    13 // Transient server example - client interface
       
    14 
       
    15 #ifndef __BTSERIALCLIENT_H__
       
    16 #define __BTSERIALCLIENT_H__
       
    17 
       
    18 #include <e32base.h>
       
    19 #include <fshell/vtc_controller.h>
       
    20 #include <bttypes.h>
       
    21 
       
    22 class RBtSerialSession : public RSessionBase
       
    23 	{
       
    24 public:
       
    25 	IMPORT_C TInt Connect();
       
    26 	IMPORT_C void Close();
       
    27 	
       
    28 	IMPORT_C void WaitForConnection(TRequestStatus& aStatus);
       
    29 	IMPORT_C void CancelWaitForConnection();
       
    30 	IMPORT_C TInt IsConnected() const;
       
    31 	IMPORT_C void Write(const TDesC8& aData, TRequestStatus& aStatus);
       
    32 	IMPORT_C void CancelWrite();
       
    33 	IMPORT_C void Read(TDes8& aData, TRequestStatus& aStatus) const;
       
    34 	IMPORT_C void CancelRead() const;	
       
    35 	
       
    36 	IMPORT_C TInt GetConnectedDeviceName(TDes& aName);
       
    37 	IMPORT_C TInt GetConnectedDeviceAddr(TBTDevAddr& aAddr);
       
    38 	
       
    39 private:
       
    40 	TInt StartServer();
       
    41 private:
       
    42 	RThread iSubThread;
       
    43 	RServer2 iServer;
       
    44 	};
       
    45 
       
    46 #endif //__BTSERIALCLIENT_H__