bluetoothapitest/bluetoothsvs/T_BTUserAPI/scripts/BT-USER-PhysicalLinks-PublicApi-Active-Master.script
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 //
       
     2 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 // All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of "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 // Nokia Corporation - initial contribution.
       
    11 //
       
    12 // Contributors:
       
    13 //
       
    14 // Description:
       
    15 //
       
    16 ///////////////////////////////////////////////////////////////////////////////
       
    17 //! @file
       
    18 //! @SYMTestSuiteName			T_BTUserAPI
       
    19 //! @SYMScriptTestEnvironment	This test script requires a basic ROM with bluetooth dongle.
       
    20 //! @SYMScriptDescription		Tests all public elements of the CBluetoothPhysicalLinks class
       
    21 //!								as a means of confidence that the API works as expected. 
       
    22 //!								The purpose is to provide a regression test suite of PublishedAll APIs for 
       
    23 //!								BT USER related classes.
       
    24 //!								Negative testing is performed to confirm that correct errors are returned 
       
    25 //!								when incorrect parameters are given. The tests are fully automated.
       
    26 //! @SYMAuthor					Sherry Ho and Zoe Chen
       
    27 //! @SYMCreationDate			16/08/2007
       
    28 ///////////////////////////////////////////////////////////////////////////////
       
    29 
       
    30 RUN_UTILS MkDir ${SYSDRIVE}\bluetooth\
       
    31 RUN_UTILS MkDir ${SYSDRIVE}\bluetooth\user\
       
    32 
       
    33 LOAD_SUITE	UCCControlTE
       
    34 LOAD_SUITE	T_BTUserAPI	-SharedData
       
    35 DELAY		2000
       
    36 
       
    37 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncService
       
    38 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartTDService
       
    39 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini BuildRunPhysicalLinksPassiveSlave
       
    40 
       
    41 DELAY		5000
       
    42 // ****************************************************************************
       
    43 // CBluetoothPhysicalLinks Master
       
    44 // **************************************************************************** 
       
    45 
       
    46 START_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0001
       
    47 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Active-Master-0001
       
    48 //! @SYMAPI						RSocketServ, CBluetoothPhysicalLinks, MBluetoothPhysicalLinksNotifier, CBluetoothSocket, 
       
    49 //!								MBluetoothSocketNotifier, TBTServiceSecurity, TL2CAPSockAddr, TBTDevAddr
       
    50 //! @SYMTestCaseDesc			Bring a new member to a piconet with waiting for 10000000 micro secs
       
    51 //!								Uses API elements: 	RSocketServ(), Connect() and Close() from RSocketServ
       
    52 //!													NewL(), CreateConnection(), Enumerate() and destructor from CBluetoothPhysicalLinks
       
    53 //!													HandleCreateConnectionCompleteL() from MBluetoothPhysicalLinksNotifier
       
    54 //!													NewL()1, Connect()1, Shutdown()1 and destructor from CBluetoothSocket
       
    55 //!													HandleConnectCompleteL() and HandleShutdownCompleteL() from MBluetoothSocketNotifier
       
    56 //!													TBTServiceSecurity() from TBTServiceSecurity
       
    57 //!													TL2CAPSockAddr(), SetSecurity(), SetBTAddr(), BTAddr() and SetPort() from TL2CAPSockAddr
       
    58 //!													TBTDevAddr() from TBTDevAddr
       
    59 //!													Open() and SetHostName() from RHostResolver
       
    60 //! @SYMTestActions				1. Order slave to set up connection
       
    61 //!								2. Get result from slave to wait for it to be ready
       
    62 //!								3. Create a connection to the RSocket server
       
    63 //!								4. Create the CBluetoothSocket object using NewL()1 (Standard constructor)
       
    64 //!								5. Create an empty TBTServiceSecurity object
       
    65 //!								6. Create an empty TBTDevAddr object (slave)
       
    66 //!								7. Create and initialise an RHostResolver
       
    67 //!								8. Set Hostname (MasterDevice) of the device
       
    68 //!								9. Get the slave device address
       
    69 //!								10. Create a TL2CAPSockAddr object
       
    70 //!								11. Set the Security of the TL2CAPSockAddr (Use default/empty as on server)
       
    71 //!								12. Set the BT address of the TL2CAPSockAddr to the one of the Casira pod of the slave that we connect to
       
    72 //!								13. Verify the set BT Address
       
    73 //!								14. Set the port to the specific one of the protocol we use
       
    74 //!								15. Create and start a session on the socket server
       
    75 //!								16. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
       
    76 //!								17. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
    77 //!								    Return KErrNone if successful
       
    78 //!								18. Verify that if return RBTDevAddrArray size (decimal 0) is as expected (decimal 0)
       
    79 //!								19. Bring in a new member to the piconet with the slave device address using 
       
    80 //!								    CreateConnection() function. Return KErrNone if successful
       
    81 //!								20. Return callback HandleCreateConnectionCompleteL() function
       
    82 //!								21. Verify that if return result (decimal 0) from callback function is as expected (decimal 0)
       
    83 //!								22. Waiting for 10000000 micro secs
       
    84 //!								23. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
    85 //!								    Return KErrNone if successful
       
    86 //!								24. Verify that if return RBTDevAddrArray size (decimal 0) is as expected (decimal 0)
       
    87 //!								25. Use the TL2CAPSockAddr in the connect of the CBluetooth object
       
    88 //!								26. HandleConnectCompleteL gets called indicating that connecting the BT connection completed
       
    89 //!								27. Get result from slave
       
    90 //!								28. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
    91 //!								    Return KErrNone if successful
       
    92 //!								29. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
    93 //!								30. Do socket cleanup by calling Shutdown()1
       
    94 //!								31. HandleShutdownCompleteL gets called verify error code
       
    95 //!								32. delete CBluetoothSocket object
       
    96 //!								33. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
    97 //!								    Return KErrNone if successful
       
    98 //!								34. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
    99 //!								35. Delete the Bluetooth socket using destructor
       
   100 //!
       
   101 //! @SYMTestStatus				Implemented
       
   102 //! @SYMTestPriority			Critical
       
   103 //! @SYMTestExpectedResults		KErrNone returned from HandleCreateConnectionCompleteL() callback
       
   104 //! @SYMTestType				CIT
       
   105 
       
   106 	START_TEST_BLOCK	100	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   107 			SHARED_ACTIVE_SCHEDULER
       
   108 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   109 			CREATE_OBJECT	TBTServiceSecurity	TBTServiceSecurity1	
       
   110 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
   111 			COMMAND		CBluetoothSocket1	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0001-0001command2NewL
       
   112 			COMMAND		TBTServiceSecurity1	Construct		
       
   113 			STORE	CBluetoothSocket1	
       
   114 			STORE	TBTServiceSecurity1	
       
   115 			STORE_ACTIVE_SCHEDULER
       
   116 	END_TEST_BLOCK
       
   117 	DELAY 2000
       
   118 
       
   119 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   120 	START_TEST_BLOCK	500	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   121 			SHARED_ACTIVE_SCHEDULER
       
   122 			CREATE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   123 			CREATE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   124 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   125 			RESTORE_OBJECT	TBTServiceSecurity	TBTServiceSecurity1	
       
   126 			COMMAND		TBTDevAddrRemote	Construct		
       
   127 			COMMAND		TBTDevAddrRemote	OpenHostResolver		BT-USER-PhysicalLinks-PublicApi-Active-0001-0002command3OpenHostResolver
       
   128 			COMMAND		TBTDevAddrRemote	SetHostNameL		BT-USER-PhysicalLinks-PublicApi-Active-0001-0002command4SetHostNameL
       
   129 			COMMAND		TBTDevAddrRemote	GetDeviceAddress		BT-USER-PhysicalLinks-PublicApi-Active-0001-0002command5GetDeviceAddress
       
   130 			OUTSTANDING
       
   131 			COMMAND		TL2CAPSockAddr1	TL2CAPSockAddr		
       
   132 			COMMAND		TL2CAPSockAddr1	SetSecurity		BT-USER-PhysicalLinks-PublicApi-Active-0001-0002command8SetSecurity
       
   133 			COMMAND		TL2CAPSockAddr1	SetBTAddr		BT-USER-PhysicalLinks-PublicApi-Active-0001-0002command9SetBTAddr
       
   134 			COMMAND		TL2CAPSockAddr1	BTAddr		BT-USER-PhysicalLinks-PublicApi-Active-0001-0002command10BTAddr
       
   135 			COMMAND		TL2CAPSockAddr1	SetPort		BT-USER-PhysicalLinks-PublicApi-Active-0001-0002command11SetPort
       
   136 			STORE	CBluetoothSocket1
       
   137 			STORE	TL2CAPSockAddr1
       
   138 			STORE	TBTDevAddrRemote	
       
   139 			STORE_ACTIVE_SCHEDULER	
       
   140 	END_TEST_BLOCK
       
   141 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   142 
       
   143 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   144 	DELAY 5000
       
   145 	START_TEST_BLOCK	2000	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   146 			SHARED_ACTIVE_SCHEDULER
       
   147 			CREATE_OBJECT	CBluetoothPhysicalLinks	CBluetoothPhysicalLinksData	
       
   148 			RESTORE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   149 			CREATE_OBJECT	RSocketServ	RSocketServData	
       
   150 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   151 			RESTORE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1
       
   152 			COMMAND		RSocketServData	RSocketServ		
       
   153 			COMMAND		RSocketServData	Connect
       
   154 			COMMAND		CBluetoothPhysicalLinksData	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0001-0003command5NewL
       
   155 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0001-0003command6Enumerate
       
   156 			COMMAND		CBluetoothPhysicalLinksData	CreateConnection		BT-USER-PhysicalLinks-PublicApi-Active-0001-0003command7CreateConnection
       
   157 			OUTSTANDING	
       
   158 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0001-0003command9Enumerate
       
   159 			COMMAND		CBluetoothSocket1	Connect		BT-USER-PhysicalLinks-PublicApi-Active-0001-0003command11Connect
       
   160 			OUTSTANDING				
       
   161 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0001-0003command13Enumerate
       
   162 			COMMAND		CBluetoothSocket1	Shutdown		BT-USER-PhysicalLinks-PublicApi-Active-0001-0003command15Shutdown
       
   163 			OUTSTANDING	
       
   164 			COMMAND		CBluetoothSocket1	~		
       
   165 			COMMAND		CBluetoothSocket1	RSocketServerClose		
       
   166 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0001-0003command20Enumerate
       
   167 			COMMAND		CBluetoothPhysicalLinksData	~		
       
   168 			COMMAND		RSocketServData	Close		
       
   169 			STORE	TBTDevAddrRemote	
       
   170 	END_TEST_BLOCK
       
   171 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   172 
       
   173 END_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0001
       
   174 
       
   175 
       
   176 START_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0002
       
   177 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Active-Master-0002
       
   178 //! @SYMAPI						RSocketServ, CBluetoothPhysicalLinks, MBluetoothPhysicalLinksNotifier, CBluetoothSocket, 
       
   179 //!								MBluetoothSocketNotifier, TBTServiceSecurity
       
   180 //! @SYMTestCaseDesc			Disconnect a single member of piconet
       
   181 //!								Uses API elements: 	RSocketServ(), Connect() and Close() from RSocketServ
       
   182 //!													NewL(), CreateConnection(), Enumerate(), Disconnect() and destructor from CBluetoothPhysicalLinks
       
   183 //!													HandleCreateConnectionCompleteL() and HandleDisconnectCompleteL() from MBluetoothPhysicalLinksNotifier
       
   184 //!													NewL()1, Connect()1, Shutdown()1 and destructor from CBluetoothSocket
       
   185 //!													HandleConnectCompleteL() and HandleShutdownCompleteL() from MBluetoothSocketNotifier
       
   186 //!													TBTServiceSecurity() from TBTServiceSecurity
       
   187 //!													TL2CAPSockAddr(), SetSecurity(), SetBTAddr(), BTAddr() and SetPort() from TL2CAPSockAddr
       
   188 //! @SYMTestActions				1. Order slave to set up connection
       
   189 //!								2. Get result from slave to wait for it to be ready
       
   190 //!								3. Create a connection to the RSocket server
       
   191 //!								4. Create the CBluetoothSocket object using NewL()1 (Standard constructor)
       
   192 //!								5. Create an empty TBTServiceSecurity object
       
   193 //!								6. Create a TL2CAPSockAddr object
       
   194 //!								7. Set the Security of the TL2CAPSockAddr (Use default/empty as on server)
       
   195 //!								8. Set the BT address of the TL2CAPSockAddr to the one of the Casira pod of the slave that we connect to
       
   196 //!								9. Verify the set BT Address
       
   197 //!								10. Set the port to the specific one of the protocol we use
       
   198 //!								11. Create and start a session on the socket server
       
   199 //!								12. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
       
   200 //!								13. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   201 //!								    Return KErrNone if successful
       
   202 //!								14. Verify that if return RBTDevAddrArray size (decimal 0) is as expected (decimal 0)
       
   203 //!								15. Bring in a new member to the piconet with the slave device address using 
       
   204 //!								    CreateConnection() function. Return KErrNone if successful
       
   205 //!								16. Return callback HandleCreateConnectionCompleteL() function
       
   206 //!								17. Verify that if return result (decimal 0) from callback function is as expected (decimal 0)
       
   207 //!								18. Waiting for 10000000 micro secs
       
   208 //!								19. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   209 //!								    Return KErrNone if successful
       
   210 //!								20. Verify that if return RBTDevAddrArray size (decimal 0) is as expected (decimal 0)
       
   211 //!								21. Use the TL2CAPSockAddr in the connect of the CBluetooth object
       
   212 //!								22. HandleConnectCompleteL gets called indicating that connecting the BT connection completed
       
   213 //!								23. Get result from slave
       
   214 //!								24. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   215 //!								    Return KErrNone if successful
       
   216 //!								25. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
   217 //!								26. Do socket cleanup by calling Shutdown()1
       
   218 //!								27. HandleShutdownCompleteL gets called verify error code
       
   219 //!								28. delete CBluetoothSocket object
       
   220 //!								29. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   221 //!								    Return KErrNone if successful
       
   222 //!								30. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
   223 //!								31. Disconnect a single member of piconet with the slave device address using Disconnect() function. 
       
   224 //!								    Return KErrNone if successful
       
   225 //!								32. Return callback HandleDisconnectCompleteL() function
       
   226 //!								33. Verify that if return result (decimal 0) from callback function is as expected (decimal 0)
       
   227 //!								34. Delete the Bluetooth socket using destructor
       
   228 //!
       
   229 //! @SYMTestStatus				Implemented
       
   230 //! @SYMTestPriority			Critical
       
   231 //! @SYMTestExpectedResults		KErrNone returned from HandleDisconnectCompleteL() callback
       
   232 //! @SYMTestType				CIT
       
   233 
       
   234 	START_TEST_BLOCK	100	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   235 			SHARED_ACTIVE_SCHEDULER
       
   236 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   237 			CREATE_OBJECT	TBTServiceSecurity	TBTServiceSecurity1	
       
   238 			CREATE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   239 			RESTORE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   240 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
   241 			COMMAND		CBluetoothSocket1	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0002-0001command2NewL
       
   242 			COMMAND		TBTServiceSecurity1	Construct		
       
   243 			COMMAND		TL2CAPSockAddr1	TL2CAPSockAddr		
       
   244 			COMMAND		TL2CAPSockAddr1	SetSecurity		BT-USER-PhysicalLinks-PublicApi-Active-0002-0001command7SetSecurity
       
   245 			COMMAND		TL2CAPSockAddr1	SetBTAddr		BT-USER-PhysicalLinks-PublicApi-Active-0002-0001command8SetBTAddr
       
   246 			COMMAND		TL2CAPSockAddr1	BTAddr		BT-USER-PhysicalLinks-PublicApi-Active-0002-0001command9BTAddr
       
   247 			COMMAND		TL2CAPSockAddr1	SetPort		BT-USER-PhysicalLinks-PublicApi-Active-0002-0001command10SetPort
       
   248 			STORE	CBluetoothSocket1	
       
   249 			STORE	TBTDevAddrRemote	
       
   250 			STORE	TL2CAPSockAddr1	
       
   251 			STORE_ACTIVE_SCHEDULER
       
   252 	END_TEST_BLOCK
       
   253 	DELAY 2000
       
   254 
       
   255 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   256 	DELAY 5000
       
   257 	START_TEST_BLOCK	1000	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   258 			SHARED_ACTIVE_SCHEDULER
       
   259 			CREATE_OBJECT	CBluetoothPhysicalLinks	CBluetoothPhysicalLinksData	
       
   260 			RESTORE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   261 			CREATE_OBJECT	RSocketServ	RSocketServData	
       
   262 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   263 			RESTORE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   264 			COMMAND		RSocketServData	RSocketServ		
       
   265 			COMMAND		RSocketServData	Connect		
       
   266 			COMMAND		CBluetoothPhysicalLinksData	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0002-0002command5NewL
       
   267 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0002-0002command6Enumerate
       
   268 			COMMAND		CBluetoothPhysicalLinksData	CreateConnection		BT-USER-PhysicalLinks-PublicApi-Active-0002-0002command7CreateConnection
       
   269 			OUTSTANDING	
       
   270 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0002-0002command9Enumerate
       
   271 			COMMAND		CBluetoothSocket1	Connect		BT-USER-PhysicalLinks-PublicApi-Active-0002-0002command11Connect
       
   272 			OUTSTANDING	
       
   273 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0002-0002command13Enumerate
       
   274 			COMMAND		CBluetoothSocket1	Shutdown		BT-USER-PhysicalLinks-PublicApi-Active-0002-0002command15Shutdown
       
   275 			OUTSTANDING	
       
   276 			COMMAND		CBluetoothSocket1	~		
       
   277 			COMMAND		CBluetoothSocket1	RSocketServerClose		
       
   278 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0002-0002command20Enumerate
       
   279 			COMMAND		CBluetoothPhysicalLinksData	Disconnect		BT-USER-PhysicalLinks-PublicApi-Active-0002-0002command21Disconnect
       
   280 			OUTSTANDING	
       
   281 			COMMAND		CBluetoothPhysicalLinksData	~		
       
   282 			COMMAND		RSocketServData	Close		
       
   283 			STORE	TBTDevAddrRemote	
       
   284 	END_TEST_BLOCK
       
   285 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   286 
       
   287 END_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0002
       
   288 
       
   289 
       
   290 START_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0003
       
   291 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Active-Master-0003
       
   292 //! @SYMAPI						RSocketServ, CBluetoothPhysicalLinks, MBluetoothPhysicalLinksNotifier, CBluetoothSocket, 
       
   293 //!								MBluetoothSocketNotifier, TBTServiceSecurity
       
   294 //! @SYMTestCaseDesc			Disconnect all members of piconet
       
   295 //!								Uses API elements: 	RSocketServ(), Connect() and Close() from RSocketServ
       
   296 //!													NewL(), CreateConnection(), Enumerate(), DisconnectAll() and destructor from CBluetoothPhysicalLinks
       
   297 //!													HandleCreateConnectionCompleteL() and HandleDisconnectAllCompleteL() from MBluetoothPhysicalLinksNotifier
       
   298 //!													NewL()1, Connect()1, Shutdown()1 and destructor from CBluetoothSocket
       
   299 //!													HandleConnectCompleteL() and HandleShutdownCompleteL() from MBluetoothSocketNotifier
       
   300 //!													TBTServiceSecurity() from TBTServiceSecurity
       
   301 //!													TL2CAPSockAddr(), SetSecurity(), SetBTAddr(), BTAddr() and SetPort() from TL2CAPSockAddr
       
   302 //! @SYMTestActions				1. Order slave to set up connection
       
   303 //!								2. Get result from slave to wait for it to be ready
       
   304 //!								3. Create a connection to the RSocket server
       
   305 //!								4. Create the CBluetoothSocket object using NewL()1 (Standard constructor)
       
   306 //!								5. Create an empty TBTServiceSecurity object
       
   307 //!								6. Create a TL2CAPSockAddr object
       
   308 //!								7. Set the Security of the TL2CAPSockAddr (Use default/empty as on server)
       
   309 //!								8. Set the BT address of the TL2CAPSockAddr to the one of the Casira pod of the slave that we connect to
       
   310 //!								9. Verify the set BT Address
       
   311 //!								10. Set the port to the specific one of the protocol we use
       
   312 //!								11. Create and start a session on the socket server
       
   313 //!								12. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
       
   314 //!								13. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   315 //!								    Return KErrNone if successful
       
   316 //!								14. Verify that if return RBTDevAddrArray size (decimal 0) is as expected (decimal 0)
       
   317 //!								15. Bring in a new member to the piconet with the slave device address using 
       
   318 //!								    CreateConnection() function. Return KErrNone if successful
       
   319 //!								16. Return callback HandleCreateConnectionCompleteL() function
       
   320 //!								17. Verify that if return result (decimal 0) from callback function is as expected (decimal 0)
       
   321 //!								18. Waiting for 10000000 micro secs
       
   322 //!								19. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   323 //!								    Return KErrNone if successful
       
   324 //!								20. Verify that if return RBTDevAddrArray size (decimal 0) is as expected (decimal 0)
       
   325 //!								21. Use the TL2CAPSockAddr in the connect of the CBluetooth object
       
   326 //!								22. HandleConnectCompleteL gets called indicating that connecting the BT connection completed
       
   327 //!								23. Get result from slave
       
   328 //!								24. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   329 //!								    Return KErrNone if successful
       
   330 //!								25. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
   331 //!								26. Do socket cleanup by calling Shutdown()1
       
   332 //!								27. HandleShutdownCompleteL gets called verify error code
       
   333 //!								28. delete CBluetoothSocket object
       
   334 //!								29. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   335 //!								    Return KErrNone if successful
       
   336 //!								30. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
   337 //!								31. Disconnect all members of piconet using DisconnectAll() function. Return KErrNone if successful
       
   338 //!								32. Return callback HandleDisconnectAllCompleteL() function
       
   339 //!								33. Verify that if return result (decimal 0) from callback function is as expected (decimal 0)
       
   340 //!								34. Delete the Bluetooth socket using destructor
       
   341 //!
       
   342 //! @SYMTestStatus				Implemented
       
   343 //! @SYMTestPriority			Critical
       
   344 //! @SYMTestExpectedResults		KErrNone Returned from HandleDisconnectAllCompleteL() callback
       
   345 //! @SYMTestType				CIT
       
   346 
       
   347 	START_TEST_BLOCK	100	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   348 			SHARED_ACTIVE_SCHEDULER
       
   349 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   350 			CREATE_OBJECT	TBTServiceSecurity	TBTServiceSecurity1	
       
   351 			CREATE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   352 			RESTORE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   353 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
   354 			COMMAND		CBluetoothSocket1	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0003-0001command2NewL
       
   355 			COMMAND		TBTServiceSecurity1	Construct		
       
   356 			COMMAND		TL2CAPSockAddr1	TL2CAPSockAddr		
       
   357 			COMMAND		TL2CAPSockAddr1	SetSecurity		BT-USER-PhysicalLinks-PublicApi-Active-0003-0001command7SetSecurity
       
   358 			COMMAND		TL2CAPSockAddr1	SetBTAddr		BT-USER-PhysicalLinks-PublicApi-Active-0003-0001command8SetBTAddr
       
   359 			COMMAND		TL2CAPSockAddr1	BTAddr		BT-USER-PhysicalLinks-PublicApi-Active-0003-0001command9BTAddr
       
   360 			COMMAND		TL2CAPSockAddr1	SetPort		BT-USER-PhysicalLinks-PublicApi-Active-0003-0001command10SetPort
       
   361 			STORE	CBluetoothSocket1	
       
   362 			STORE	TBTDevAddrRemote	
       
   363 			STORE	TL2CAPSockAddr1	
       
   364 			STORE_ACTIVE_SCHEDULER
       
   365 	END_TEST_BLOCK
       
   366 	DELAY 5000
       
   367 
       
   368 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   369 	DELAY 5000
       
   370 	START_TEST_BLOCK	1000	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   371 			SHARED_ACTIVE_SCHEDULER
       
   372 			CREATE_OBJECT	CBluetoothPhysicalLinks	CBluetoothPhysicalLinksData	
       
   373 			RESTORE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   374 			CREATE_OBJECT	RSocketServ	RSocketServData	
       
   375 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   376 			RESTORE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   377 			COMMAND		RSocketServData	RSocketServ		
       
   378 			COMMAND		RSocketServData	Connect		
       
   379 			COMMAND		CBluetoothPhysicalLinksData	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0003-0002command5NewL
       
   380 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0003-0002command6Enumerate
       
   381 			COMMAND		CBluetoothPhysicalLinksData	CreateConnection		BT-USER-PhysicalLinks-PublicApi-Active-0003-0002command7CreateConnection
       
   382 			OUTSTANDING	
       
   383 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0003-0002command9Enumerate
       
   384 			COMMAND		CBluetoothSocket1	Connect		BT-USER-PhysicalLinks-PublicApi-Active-0003-0002command11Connect
       
   385 			OUTSTANDING	
       
   386 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0003-0002command13Enumerate
       
   387 			COMMAND		CBluetoothSocket1	Shutdown		BT-USER-PhysicalLinks-PublicApi-Active-0003-0002command15Shutdown
       
   388 			OUTSTANDING	
       
   389 			COMMAND		CBluetoothSocket1	~		
       
   390 			COMMAND		CBluetoothSocket1	RSocketServerClose		
       
   391 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0003-0002command20Enumerate
       
   392 			COMMAND		CBluetoothPhysicalLinksData	DisconnectAll		BT-USER-PhysicalLinks-PublicApi-Active-0003-0002command21DisconnectAll
       
   393 			OUTSTANDING	
       
   394 			COMMAND		CBluetoothPhysicalLinksData	~		
       
   395 			COMMAND		RSocketServData	Close		
       
   396 			STORE	TBTDevAddrRemote	
       
   397 	END_TEST_BLOCK
       
   398 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   399 
       
   400 END_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0003
       
   401 
       
   402 
       
   403 START_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0004
       
   404 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Active-Master-0004
       
   405 //! @SYMAPI						RSocketServ, CBluetoothPhysicalLinks, MBluetoothPhysicalLinksNotifier, CBluetoothSocket, 
       
   406 //!								MBluetoothSocketNotifier, TBTServiceSecurity
       
   407 //! @SYMTestCaseDesc			Disconnect a single member (invalid bluetooth address) of piconet
       
   408 //!								Uses API elements: 	RSocketServ(), Connect() and Close() from RSocketServ
       
   409 //!													NewL(), CreateConnection(), Enumerate(), Disconnect() and destructor from CBluetoothPhysicalLinks
       
   410 //!													HandleCreateConnectionCompleteL() and HandleDisconnectCompleteL() from MBluetoothPhysicalLinksNotifier
       
   411 //!													NewL()1, Connect()1, Shutdown()1 and destructor from CBluetoothSocket
       
   412 //!													HandleConnectCompleteL() and HandleShutdownCompleteL() from MBluetoothSocketNotifier
       
   413 //!													TBTServiceSecurity() from TBTServiceSecurity
       
   414 //!													TL2CAPSockAddr(), SetSecurity(), SetBTAddr(), BTAddr() and SetPort() from TL2CAPSockAddr
       
   415 //! @SYMTestActions				1. Order slave to set up connection
       
   416 //!								2. Get result from slave to wait for it to be ready
       
   417 //!								3. Create a connection to the RSocket server
       
   418 //!								4. Create the CBluetoothSocket object using NewL()1 (Standard constructor)
       
   419 //!								5. Create an empty TBTServiceSecurity object
       
   420 //!								6. Create a TL2CAPSockAddr object
       
   421 //!								7. Set the Security of the TL2CAPSockAddr (Use default/empty as on server)
       
   422 //!								8. Set the BT address of the TL2CAPSockAddr to the one of the Casira pod of the slave that we connect to
       
   423 //!								9. Verify the set BT Address
       
   424 //!								10. Set the port to the specific one of the protocol we use
       
   425 //!								11. Create and start a session on the socket server
       
   426 //!								12. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
       
   427 //!								13. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   428 //!								    Return KErrNone if successful
       
   429 //!								14. Verify that if return RBTDevAddrArray size (decimal 0) is as expected (decimal 0)
       
   430 //!								15. Bring in a new member to the piconet with the slave device address using 
       
   431 //!								    CreateConnection() function. Return KErrNone if successful
       
   432 //!								16. Return callback HandleCreateConnectionCompleteL() function
       
   433 //!								17. Verify that if return result (decimal 0) from callback function is as expected (decimal 0)
       
   434 //!								18. Waiting for 10000000 micro secs
       
   435 //!								19. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   436 //!								    Return KErrNone if successful
       
   437 //!								20. Verify that if return RBTDevAddrArray size (decimal 0) is as expected (decimal 0)
       
   438 //!								21. Use the TL2CAPSockAddr in the connect of the CBluetooth object
       
   439 //!								22. HandleConnectCompleteL gets called indicating that connecting the BT connection completed
       
   440 //!								23. Get result from slave
       
   441 //!								24. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   442 //!								    Return KErrNone if successful
       
   443 //!								25. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
   444 //!								26. Do socket cleanup by calling Shutdown()1
       
   445 //!								27. HandleShutdownCompleteL gets called verify error code
       
   446 //!								28. delete CBluetoothSocket object
       
   447 //!								29. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   448 //!								    Return KErrNone if successful
       
   449 //!								30. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
   450 //!								31. Disconnect a single member of piconet with an invalid device address using CreateConnection() 
       
   451 //!								    function. Return KErrNone if successful
       
   452 //!								32. Return callback HandleDisconnectCompleteL() function
       
   453 //!								33. Verify that if return result (decimal 0) from callback function is as expected (decimal 0)
       
   454 //!								34. Delete the Bluetooth socket using destructor
       
   455 //!
       
   456 //! @SYMTestStatus				Implemented
       
   457 //! @SYMTestPriority			Critical
       
   458 //! @SYMTestExpectedResults		Returned KErrNone from HandleDisconnectCompleteL() callback
       
   459 //! @SYMTestType				CIT
       
   460 
       
   461 	START_TEST_BLOCK	100	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   462 			SHARED_ACTIVE_SCHEDULER
       
   463 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   464 			CREATE_OBJECT	TBTServiceSecurity	TBTServiceSecurity1	
       
   465 			CREATE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   466 			RESTORE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   467 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
   468 			COMMAND		CBluetoothSocket1	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0004-0001command2NewL
       
   469 			COMMAND		TBTServiceSecurity1	Construct		
       
   470 			COMMAND		TL2CAPSockAddr1	TL2CAPSockAddr		
       
   471 			COMMAND		TL2CAPSockAddr1	SetSecurity		BT-USER-PhysicalLinks-PublicApi-Active-0004-0001command7SetSecurity
       
   472 			COMMAND		TL2CAPSockAddr1	SetBTAddr		BT-USER-PhysicalLinks-PublicApi-Active-0004-0001command8SetBTAddr
       
   473 			COMMAND		TL2CAPSockAddr1	BTAddr		BT-USER-PhysicalLinks-PublicApi-Active-0004-0001command9BTAddr
       
   474 			COMMAND		TL2CAPSockAddr1	SetPort		BT-USER-PhysicalLinks-PublicApi-Active-0004-0001command10SetPort
       
   475 			STORE	CBluetoothSocket1	
       
   476 			STORE	TBTDevAddrRemote	
       
   477 			STORE	TL2CAPSockAddr1	
       
   478 			STORE_ACTIVE_SCHEDULER
       
   479 	END_TEST_BLOCK
       
   480 	DELAY 5000
       
   481 
       
   482 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   483 	DELAY 5000
       
   484 	START_TEST_BLOCK	1000	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   485 			SHARED_ACTIVE_SCHEDULER
       
   486 			CREATE_OBJECT	CBluetoothPhysicalLinks	CBluetoothPhysicalLinksData	
       
   487 			RESTORE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   488 			CREATE_OBJECT	RSocketServ	RSocketServData	
       
   489 			CREATE_OBJECT	TBTDevAddr	TBTDevAddrData	
       
   490 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   491 			RESTORE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   492 			COMMAND		TBTDevAddrData	Construct		
       
   493 			COMMAND		RSocketServData	RSocketServ		
       
   494 			COMMAND		RSocketServData	Connect		
       
   495 			COMMAND		CBluetoothPhysicalLinksData	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0004-0002command7NewL
       
   496 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0004-0002command8Enumerate
       
   497 			COMMAND		CBluetoothPhysicalLinksData	CreateConnection		BT-USER-PhysicalLinks-PublicApi-Active-0004-0002command9CreateConnection
       
   498 			OUTSTANDING	
       
   499 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0004-0002command11Enumerate
       
   500 			COMMAND		CBluetoothSocket1	Connect		BT-USER-PhysicalLinks-PublicApi-Active-0004-0002command13Connect
       
   501 			OUTSTANDING	
       
   502 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0004-0002command15Enumerate
       
   503 			COMMAND		CBluetoothSocket1	Shutdown		BT-USER-PhysicalLinks-PublicApi-Active-0004-0002command17Shutdown
       
   504 			OUTSTANDING	
       
   505 			COMMAND		CBluetoothSocket1	~		
       
   506 			COMMAND		CBluetoothSocket1	RSocketServerClose		
       
   507 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0004-0002command22Enumerate
       
   508 			COMMAND		CBluetoothPhysicalLinksData	Disconnect		BT-USER-PhysicalLinks-PublicApi-Active-0004-0002command23Disconnect
       
   509 			OUTSTANDING	
       
   510 			COMMAND		CBluetoothPhysicalLinksData	~		
       
   511 			COMMAND		RSocketServData	Close		
       
   512 			STORE	TBTDevAddrRemote	
       
   513 	END_TEST_BLOCK
       
   514 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   515 
       
   516 END_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0004
       
   517 
       
   518 
       
   519 START_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0005
       
   520 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Active-Master-0005
       
   521 //! @SYMAPI						RSocketServ, CBluetoothPhysicalLinks, MBluetoothPhysicalLinksNotifier, CBluetoothSocket, 
       
   522 //!								MBluetoothSocketNotifier, TBTServiceSecurity
       
   523 //! @SYMTestCaseDesc			Enumerate connected members of the piconet while defining the upper limit on numbers of members to be returned as 0
       
   524 //!								Uses API elements: 	RSocketServ(), Connect() and Close() from RSocketServ
       
   525 //!													NewL(), CreateConnection(), Enumerate() and destructor from CBluetoothPhysicalLinks
       
   526 //!													HandleCreateConnectionCompleteL() from MBluetoothPhysicalLinksNotifier
       
   527 //!													NewL()1, Connect()1, Shutdown()1 and destructor from CBluetoothSocket
       
   528 //!													HandleConnectCompleteL() and HandleShutdownCompleteL() from MBluetoothSocketNotifier
       
   529 //!													TBTServiceSecurity() from TBTServiceSecurity
       
   530 //!													TL2CAPSockAddr(), SetSecurity(), SetBTAddr(), BTAddr() and SetPort() from TL2CAPSockAddr
       
   531 //! @SYMTestActions				1. Order slave to set up connection
       
   532 //!								2. Get result from slave to wait for it to be ready
       
   533 //!								3. Create a connection to the RSocket server
       
   534 //!								4. Create the CBluetoothSocket object using NewL()1 (Standard constructor)
       
   535 //!								5. Create an empty TBTServiceSecurity object
       
   536 //!								6. Create a TL2CAPSockAddr object
       
   537 //!								7. Set the Security of the TL2CAPSockAddr (Use default/empty as on server)
       
   538 //!								8. Set the BT address of the TL2CAPSockAddr to the one of the Casira pod of the slave that we connect to
       
   539 //!								9. Verify the set BT Address
       
   540 //!								10. Set the port to the specific one of the protocol we use
       
   541 //!								11. Create and start a session on the socket server
       
   542 //!								12. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
       
   543 //!								13. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   544 //!								    Return KErrNone if successful
       
   545 //!								14. Verify that if return RBTDevAddrArray size (decimal 0) is as expected (decimal 0)
       
   546 //!								15. Bring in a new member to the piconet with the slave device address using 
       
   547 //!								    CreateConnection() function. Return KErrNone if successful
       
   548 //!								16. Return callback HandleCreateConnectionCompleteL() function
       
   549 //!								17. Verify that if return result (decimal 0) from callback function is as expected (decimal 0)
       
   550 //!								18. Waiting for 1 micro secs
       
   551 //!								19. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   552 //!								    Return KErrNone if successful
       
   553 //!								20. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
   554 //!								21. Use the TL2CAPSockAddr in the connect of the CBluetooth object
       
   555 //!								22. HandleConnectCompleteL gets called indicating that connecting the BT connection completed
       
   556 //!								23. Get result from slave
       
   557 //!								24. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   558 //!								    Return KErrNone if successful
       
   559 //!								25. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
   560 //!								26. Do socket cleanup by calling Shutdown()1
       
   561 //!								27. HandleShutdownCompleteL gets called verify error code
       
   562 //!								28. delete CBluetoothSocket object
       
   563 //!								29. Enumerate connected members of the piconet with given maximum number of members (decimal 0) to be returned.
       
   564 //!								    Return KErrNone if successful
       
   565 //!								30. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
   566 //!								31. Delete the Bluetooth socket using destructor
       
   567 //!
       
   568 //! @SYMTestStatus				Implemented
       
   569 //! @SYMTestPriority			Critical
       
   570 //! @SYMTestExpectedResults		KErrArgument returned
       
   571 //! @SYMTestType				CIT
       
   572 
       
   573 	START_TEST_BLOCK	100	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   574 			SHARED_ACTIVE_SCHEDULER
       
   575 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   576 			CREATE_OBJECT	TBTServiceSecurity	TBTServiceSecurity1	
       
   577 			CREATE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   578 			RESTORE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   579 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
   580 			COMMAND		CBluetoothSocket1	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0005-0001command2NewL
       
   581 			COMMAND		TBTServiceSecurity1	Construct		
       
   582 			COMMAND		TL2CAPSockAddr1	TL2CAPSockAddr		
       
   583 			COMMAND		TL2CAPSockAddr1	SetSecurity		BT-USER-PhysicalLinks-PublicApi-Active-0005-0001command7SetSecurity
       
   584 			COMMAND		TL2CAPSockAddr1	SetBTAddr		BT-USER-PhysicalLinks-PublicApi-Active-0005-0001command8SetBTAddr
       
   585 			COMMAND		TL2CAPSockAddr1	BTAddr		BT-USER-PhysicalLinks-PublicApi-Active-0005-0001command9BTAddr
       
   586 			COMMAND		TL2CAPSockAddr1	SetPort		BT-USER-PhysicalLinks-PublicApi-Active-0005-0001command10SetPort
       
   587 			STORE	CBluetoothSocket1	
       
   588 			STORE	TBTDevAddrRemote	
       
   589 			STORE	TL2CAPSockAddr1	
       
   590 			STORE_ACTIVE_SCHEDULER
       
   591 	END_TEST_BLOCK
       
   592 	DELAY 5000
       
   593 
       
   594 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   595 	DELAY 5000
       
   596 	START_TEST_BLOCK	1000	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   597 			SHARED_ACTIVE_SCHEDULER
       
   598 			CREATE_OBJECT	CBluetoothPhysicalLinks	CBluetoothPhysicalLinksData	
       
   599 			RESTORE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   600 			CREATE_OBJECT	RSocketServ	RSocketServData	
       
   601 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   602 			RESTORE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   603 			COMMAND		RSocketServData	RSocketServ		
       
   604 			COMMAND		RSocketServData	Connect		
       
   605 			COMMAND		CBluetoothPhysicalLinksData	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0005-0002command5NewL
       
   606 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0005-0002command6Enumerate
       
   607 			COMMAND		CBluetoothPhysicalLinksData	CreateConnection		BT-USER-PhysicalLinks-PublicApi-Active-0005-0002command7CreateConnection
       
   608 			OUTSTANDING	
       
   609 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0005-0002command9Enumerate
       
   610 			COMMAND		CBluetoothSocket1	Connect		BT-USER-PhysicalLinks-PublicApi-Active-0005-0002command11Connect
       
   611 			OUTSTANDING	
       
   612 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0005-0002command13Enumerate
       
   613 			COMMAND		CBluetoothSocket1	Shutdown		BT-USER-PhysicalLinks-PublicApi-Active-0005-0002command15Shutdown
       
   614 			OUTSTANDING	
       
   615 			COMMAND		CBluetoothSocket1	~		
       
   616 			COMMAND		CBluetoothSocket1	RSocketServerClose		
       
   617 			COMMAND	!Error=-6		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0005-0002command20Enumerate
       
   618 			COMMAND		CBluetoothPhysicalLinksData	~		
       
   619 			COMMAND		RSocketServData	Close		
       
   620 			STORE	TBTDevAddrRemote	
       
   621 	END_TEST_BLOCK
       
   622 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   623 
       
   624 END_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0005
       
   625 
       
   626 
       
   627 START_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0006
       
   628 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Active-Master-0006
       
   629 //! @SYMAPI						RSocketServ, CBluetoothPhysicalLinks, MBluetoothPhysicalLinksNotifier, CBluetoothSocket, 
       
   630 //!								MBluetoothSocketNotifier, TBTServiceSecurity
       
   631 //! @SYMTestCaseDesc			Bring a new member to a piconet with waiting for 1 micro secs
       
   632 //!								Uses API elements: 	RSocketServ(), Connect() and Close() from RSocketServ
       
   633 //!													NewL(), CreateConnection(), Enumerate() and destructor from CBluetoothPhysicalLinks
       
   634 //!													HandleCreateConnectionCompleteL() from MBluetoothPhysicalLinksNotifier
       
   635 //!													NewL()1, Connect()1, Shutdown()1 and destructor from CBluetoothSocket
       
   636 //!													HandleConnectCompleteL() and HandleShutdownCompleteL() from MBluetoothSocketNotifier
       
   637 //!													TBTServiceSecurity() from TBTServiceSecurity
       
   638 //!													TL2CAPSockAddr(), SetSecurity(), SetBTAddr(), BTAddr() and SetPort() from TL2CAPSockAddr
       
   639 //! @SYMTestActions				1. Order slave to set up connection
       
   640 //!								2. Get result from slave to wait for it to be ready
       
   641 //!								3. Create a connection to the RSocket server
       
   642 //!								4. Create the CBluetoothSocket object using NewL()1 (Standard constructor)
       
   643 //!								5. Create an empty TBTServiceSecurity object
       
   644 //!								6. Create a TL2CAPSockAddr object
       
   645 //!								7. Set the Security of the TL2CAPSockAddr (Use default/empty as on server)
       
   646 //!								8. Set the BT address of the TL2CAPSockAddr to the one of the Casira pod of the slave that we connect to
       
   647 //!								9. Verify the set BT Address
       
   648 //!								10. Set the port to the specific one of the protocol we use
       
   649 //!								11. Create and start a session on the socket server
       
   650 //!								12. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
       
   651 //!								13. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   652 //!								    Return KErrNone if successful
       
   653 //!								14. Verify that if return RBTDevAddrArray size (decimal 0) is as expected (decimal 0)
       
   654 //!								15. Bring in a new member to the piconet with the slave device address using 
       
   655 //!								    CreateConnection() function. Return KErrNone if successful
       
   656 //!								16. Return callback HandleCreateConnectionCompleteL() function
       
   657 //!								17. Verify that if return result (decimal 0) from callback function is as expected (decimal 0)
       
   658 //!								18. Waiting for 1 micro secs
       
   659 //!								19. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   660 //!								    Return KErrNone if successful
       
   661 //!								20. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
   662 //!								21. Use the TL2CAPSockAddr in the connect of the CBluetooth object
       
   663 //!								22. HandleConnectCompleteL gets called indicating that connecting the BT connection completed
       
   664 //!								23. Get result from slave
       
   665 //!								24. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   666 //!								    Return KErrNone if successful
       
   667 //!								25. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
   668 //!								26. Do socket cleanup by calling Shutdown()1
       
   669 //!								27. HandleShutdownCompleteL gets called verify error code
       
   670 //!								28. delete CBluetoothSocket object
       
   671 //!								29. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   672 //!								    Return KErrNone if successful
       
   673 //!								30. Verify that if return RBTDevAddrArray size (decimal 1) is as expected (decimal 1)
       
   674 //!								31. Delete the Bluetooth socket using destructor
       
   675 //!
       
   676 //! @SYMTestStatus				Implemented
       
   677 //! @SYMTestPriority			Critical
       
   678 //! @SYMTestExpectedResults		Returned KErrNone from HandleCreateConnectionCompleteL() callback
       
   679 //! @SYMTestType				CIT
       
   680 
       
   681 	START_TEST_BLOCK	100	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   682 			SHARED_ACTIVE_SCHEDULER
       
   683 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   684 			CREATE_OBJECT	TBTServiceSecurity	TBTServiceSecurity1	
       
   685 			CREATE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   686 			RESTORE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   687 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
   688 			COMMAND		CBluetoothSocket1	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0006-0001command2NewL
       
   689 			COMMAND		TBTServiceSecurity1	Construct		
       
   690 			COMMAND		TL2CAPSockAddr1	TL2CAPSockAddr		
       
   691 			COMMAND		TL2CAPSockAddr1	SetSecurity		BT-USER-PhysicalLinks-PublicApi-Active-0006-0001command7SetSecurity
       
   692 			COMMAND		TL2CAPSockAddr1	SetBTAddr		BT-USER-PhysicalLinks-PublicApi-Active-0006-0001command8SetBTAddr
       
   693 			COMMAND		TL2CAPSockAddr1	BTAddr		BT-USER-PhysicalLinks-PublicApi-Active-0006-0001command9BTAddr
       
   694 			COMMAND		TL2CAPSockAddr1	SetPort		BT-USER-PhysicalLinks-PublicApi-Active-0006-0001command10SetPort
       
   695 			STORE	CBluetoothSocket1	
       
   696 			STORE	TBTDevAddrRemote	
       
   697 			STORE	TL2CAPSockAddr1	
       
   698 			STORE_ACTIVE_SCHEDULER
       
   699 	END_TEST_BLOCK
       
   700 	DELAY 5000
       
   701 
       
   702 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StartSyncTestCase
       
   703 	DELAY 5000
       
   704 	START_TEST_BLOCK	1000	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   705 			SHARED_ACTIVE_SCHEDULER
       
   706 			CREATE_OBJECT	CBluetoothPhysicalLinks	CBluetoothPhysicalLinksData	
       
   707 			RESTORE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   708 			CREATE_OBJECT	RSocketServ	RSocketServData	
       
   709 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   710 			RESTORE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   711 			COMMAND		RSocketServData	RSocketServ		
       
   712 			COMMAND		RSocketServData	Connect		
       
   713 			COMMAND		CBluetoothPhysicalLinksData	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0006-0002command5NewL
       
   714 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0006-0002command6Enumerate
       
   715 			COMMAND		CBluetoothPhysicalLinksData	CreateConnection		BT-USER-PhysicalLinks-PublicApi-Active-0006-0002command7CreateConnection
       
   716 			OUTSTANDING	
       
   717 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0006-0002command9Enumerate
       
   718 			COMMAND		CBluetoothSocket1	Connect		BT-USER-PhysicalLinks-PublicApi-Active-0006-0002command11Connect
       
   719 			OUTSTANDING	
       
   720 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0006-0002command13Enumerate
       
   721 			COMMAND		CBluetoothSocket1	Shutdown		BT-USER-PhysicalLinks-PublicApi-Active-0006-0002command15Shutdown
       
   722 			OUTSTANDING	
       
   723 			COMMAND		CBluetoothSocket1	~		
       
   724 			COMMAND		CBluetoothSocket1	RSocketServerClose		
       
   725 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0006-0002command20Enumerate
       
   726 			COMMAND		CBluetoothPhysicalLinksData	~		
       
   727 			COMMAND		RSocketServData	Close		
       
   728 			STORE	TBTDevAddrRemote	
       
   729 			STORE_ACTIVE_SCHEDULER
       
   730 	END_TEST_BLOCK
       
   731 	RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveSyncTestCaseResult
       
   732 
       
   733 END_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0006
       
   734 
       
   735 DELAY 5000
       
   736 
       
   737 START_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0007
       
   738 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Active-Master-0007
       
   739 //! @SYMAPI						RSocketServ, CBluetoothPhysicalLinks, MBluetoothPhysicalLinksNotifier
       
   740 //! @SYMTestCaseDesc			Cancel bringing a new member to a piconet
       
   741 //!								Uses API elements: 	RSocketServ(), Connect() and Close() from RSocketServ
       
   742 //!													NewL(), CreateConnection(), CancelCreateConnection() and destructor from CBluetoothPhysicalLinks
       
   743 //!													HandleCreateConnectionCompleteL() from MBluetoothPhysicalLinksNotifier
       
   744 //! @SYMTestActions				1. Create and start a session on the socket server
       
   745 //!								2. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
       
   746 //!								3. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   747 //!								   Return KErrNone if successful
       
   748 //!								4. Verify that if return RBTDevAddrArray size (decimal 0) is as expected (decimal 0)
       
   749 //!								5. Bring in a new member to the piconet with the slave device address using 
       
   750 //!								   CreateConnection() function. Return KErrNone if successful
       
   751 //!								6. Return callback HandleCreateConnectionCompleteL() function
       
   752 //!								7. Verify that if return result (decimal 0) from callback function is as expected (decimal 0)
       
   753 //!								8. Waiting for 10000000 micro secs
       
   754 //!								9. Cancel bringing in a new member to the piconet with the slave device address using 
       
   755 //!								   CancelCreateConnection() function
       
   756 //!								10. Delete the Bluetooth socket using destructor
       
   757 //!
       
   758 //! @SYMTestStatus				Implemented
       
   759 //! @SYMTestPriority			Critical
       
   760 //! @SYMTestExpectedResults		Cancel succeeded
       
   761 //! @SYMTestType				CIT
       
   762 
       
   763 	START_TEST_BLOCK	1000	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   764 			SHARED_ACTIVE_SCHEDULER
       
   765 			CREATE_OBJECT	CBluetoothPhysicalLinks	CBluetoothPhysicalLinksData	
       
   766 			RESTORE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   767 			CREATE_OBJECT	RSocketServ	RSocketServData	
       
   768 			COMMAND		RSocketServData	RSocketServ		
       
   769 			COMMAND		RSocketServData	Connect		
       
   770 			COMMAND		CBluetoothPhysicalLinksData	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0007-0001command5NewL
       
   771 			COMMAND		CBluetoothPhysicalLinksData	Enumerate		BT-USER-PhysicalLinks-PublicApi-Active-0007-0001command6Enumerate
       
   772 			COMMAND		CBluetoothPhysicalLinksData	CreateConnection		BT-USER-PhysicalLinks-PublicApi-Active-0007-0001command7CreateConnection
       
   773 			COMMAND		CBluetoothPhysicalLinksData	CancelCreateConnection		
       
   774 			OUTSTANDING	
       
   775 			COMMAND		CBluetoothPhysicalLinksData	~		
       
   776 			COMMAND		RSocketServData	Close		
       
   777 			STORE	TBTDevAddrRemote	
       
   778 	END_TEST_BLOCK
       
   779 
       
   780 END_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0007
       
   781 
       
   782 
       
   783 START_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0008
       
   784 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Active-Master-0008
       
   785 //! @SYMAPI						RSocketServ, CBluetoothPhysicalLinks, MBluetoothPhysicalLinksNotifier
       
   786 //! @SYMTestCaseDesc			Bring in a new member to the piconet with a invalid device address
       
   787 //!								Uses API elements: 	RSocketServ(), Connect() and Close() from RSocketServ
       
   788 //!													NewL(), CreateConnection() and destructor from CBluetoothPhysicalLinks
       
   789 //!													HandleCreateConnectionCompleteL() from MBluetoothPhysicalLinksNotifier
       
   790 //! @SYMTestActions				1. Create and start a session on the socket server
       
   791 //!								2. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
       
   792 //!								3. Bring in a new member to the piconet with a invalid device address using 
       
   793 //!								   CreateConnection() function. Return KErrNone if successful
       
   794 //!								4. Return callback HandleCreateConnectionCompleteL() function
       
   795 //!								5. Verify that if return result (Error -6004) from callback function is as expected (Error -6004)
       
   796 //!								6. Delete the Bluetooth socket using destructor
       
   797 //!
       
   798 //! @SYMTestStatus				Implemented
       
   799 //! @SYMTestPriority			Critical
       
   800 //! @SYMTestExpectedResults		EPageTimedOut (-6004) returned as expected at step 4
       
   801 //! @SYMTestType				CIT
       
   802 
       
   803 	START_TEST_BLOCK	2000	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   804 			SHARED_ACTIVE_SCHEDULER
       
   805 			CREATE_OBJECT	CBluetoothPhysicalLinks	CBluetoothPhysicalLinksData	
       
   806 			CREATE_OBJECT	RSocketServ	RSocketServData	
       
   807 			COMMAND		RSocketServData	RSocketServ		
       
   808 			COMMAND		RSocketServData	Connect		
       
   809 			COMMAND		CBluetoothPhysicalLinksData	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0008-0001command5NewL
       
   810 			COMMAND		CBluetoothPhysicalLinksData	CreateConnection		BT-USER-PhysicalLinks-PublicApi-Active-0008-0001command6CreateConnection
       
   811 			OUTSTANDING	
       
   812 			COMMAND		CBluetoothPhysicalLinksData	~		
       
   813 			COMMAND		RSocketServData	Close		
       
   814 	END_TEST_BLOCK
       
   815 
       
   816 END_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0008
       
   817 
       
   818 
       
   819 START_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0009
       
   820 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Active-Master-0009
       
   821 //! @SYMAPI						RSocketServ, CBluetoothPhysicalLinks
       
   822 //! @SYMTestCaseDesc			Cancel brining a new member to piconet without bring in a new member to the piconet
       
   823 //!								Uses API elements: 	RSocketServ(), Connect() and Close() from RSocketServ
       
   824 //!													NewLC(), CancelCreateConnection(), and destructor from CBluetoothPhysicalLinks
       
   825 //! @SYMTestActions				1. Create and start a session on the socket server
       
   826 //!								2. Open a Bluetooth socket using NewLC() function. Return KErrNone if successful
       
   827 //!								3. Cancel bringing in a new member to the piconet with a device address using 
       
   828 //!								   CancelCreateConnection() function
       
   829 //!								4. Delete the Bluetooth socket using destructor
       
   830 //!
       
   831 //! @SYMTestStatus				Implemented
       
   832 //! @SYMTestPriority			Critical
       
   833 //! @SYMTestExpectedResults		Cancel succeeded
       
   834 //! @SYMTestType				CIT
       
   835 
       
   836 	START_TEST_BLOCK	1000	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   837 			SHARED_ACTIVE_SCHEDULER
       
   838 			CREATE_OBJECT	CBluetoothPhysicalLinks	CBluetoothPhysicalLinksData	
       
   839 			CREATE_OBJECT	RSocketServ	RSocketServData	
       
   840 			COMMAND		RSocketServData	RSocketServ		
       
   841 			COMMAND		RSocketServData	Connect		
       
   842 			COMMAND		CBluetoothPhysicalLinksData	NewLC		BT-USER-PhysicalLinks-PublicApi-Active-0009-0001command5NewLC
       
   843 			COMMAND		CBluetoothPhysicalLinksData	CancelCreateConnection		
       
   844 			COMMAND		CBluetoothPhysicalLinksData	~		
       
   845 			COMMAND		RSocketServData	Close		
       
   846 	END_TEST_BLOCK
       
   847 
       
   848 END_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0009
       
   849 
       
   850 
       
   851 START_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0010
       
   852 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Active-Master-0010
       
   853 //! @SYMAPI						RSocketServ, CBluetoothPhysicalLinks, MBluetoothPhysicalLinksNotifier
       
   854 //! @SYMTestCaseDesc			Disconnect all members of piconet without bringing in a new member to the piconet
       
   855 //!								Uses API elements: 	RSocketServ(), Connect() and Close() from RSocketServ
       
   856 //!													NewL(), DisconnectAll(), and destructor from CBluetoothPhysicalLinks
       
   857 //!													HandleDisconnectAllCompleteL() from MBluetoothPhysicalLinksNotifier
       
   858 //! @SYMTestActions				1. Create and start a session on the socket server
       
   859 //!								2. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
       
   860 //!								3. Disconnect all members of piconet using DisconnectAll() function. Return KErrNone if successful
       
   861 //!								4. Return callback HandleDisconnectAllCompleteL() function
       
   862 //!								5. Verify that if return result (decimal 0) from callback function is as expected (decimal 0)
       
   863 //!								6. Delete the Bluetooth socket using destructor
       
   864 //!
       
   865 //! @SYMTestStatus				Implemented
       
   866 //! @SYMTestPriority			Critical
       
   867 //! @SYMTestExpectedResults		Returned KErrNone from HandleDisconnectAllCompleteL() callback
       
   868 //! @SYMTestType				CIT
       
   869 
       
   870 	START_TEST_BLOCK	2000	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   871 			SHARED_ACTIVE_SCHEDULER
       
   872 			CREATE_OBJECT	CBluetoothPhysicalLinks	CBluetoothPhysicalLinksData	
       
   873 			CREATE_OBJECT	RSocketServ	RSocketServData	
       
   874 			COMMAND		RSocketServData	RSocketServ		
       
   875 			COMMAND		RSocketServData	Connect		
       
   876 			COMMAND		CBluetoothPhysicalLinksData	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0010-0001command5NewL
       
   877 			COMMAND		CBluetoothPhysicalLinksData	DisconnectAll		BT-USER-PhysicalLinks-PublicApi-Active-0010-0001command6DisconnectAll
       
   878 			OUTSTANDING	
       
   879 			COMMAND		CBluetoothPhysicalLinksData	~		
       
   880 			COMMAND		RSocketServData	Close		
       
   881 	END_TEST_BLOCK
       
   882 
       
   883 END_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0010
       
   884 
       
   885 
       
   886 START_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0011
       
   887 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Active-Master-0011
       
   888 //! @SYMAPI						RSocketServ, CBluetoothPhysicalLinks, MBluetoothPhysicalLinksNotifier
       
   889 //! @SYMTestCaseDesc			Disconnect a single member of piconet without bringing in a new member to the piconet
       
   890 //!								Uses API elements: 	RSocketServ(), Connect() and Close() from RSocketServ
       
   891 //!													NewL(), Disconnect(), Enumerate() and destructor from CBluetoothPhysicalLinks
       
   892 //!													HandleDisconnectCompleteL() from MBluetoothPhysicalLinksNotifier
       
   893 //! @SYMTestActions				1. Create and start a session on the socket server
       
   894 //!								2. Open a Bluetooth socket using NewL() function. Return KErrNone if successful
       
   895 //!								3. Disconnect a single member of piconet using Disconnect() function. Return KErrNone if successful
       
   896 //!								4. Return callback HandleDisconnectCompleteL() function
       
   897 //!								5. Verify that if return result (decimal 0) from callback function is as expected (decimal 0)
       
   898 //!								6. Enumerate connected members of the piconet with given maximum number of members (decimal 7) to be returned.
       
   899 //!								   Return KErrNone if successful
       
   900 //!								7. Verify that if return RBTDevAddrArray size (decimal 0) is as expected (decimal 0)
       
   901 //!								8. Delete the Bluetooth socket using destructor
       
   902 //!
       
   903 //! @SYMTestStatus				Implemented
       
   904 //! @SYMTestPriority			Critical
       
   905 //! @SYMTestExpectedResults		Returned KErrNone from HandleDisconnectCompleteL() callback
       
   906 //! @SYMTestType				CIT
       
   907 
       
   908 	START_TEST_BLOCK	2000	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Active-Master.ini
       
   909 			SHARED_ACTIVE_SCHEDULER
       
   910 			CREATE_OBJECT	CBluetoothPhysicalLinks	CBluetoothPhysicalLinksData	
       
   911 			RESTORE_OBJECT	TBTDevAddr	TBTDevAddrRemote	
       
   912 			CREATE_OBJECT	RSocketServ	RSocketServData	
       
   913 			COMMAND		RSocketServData	RSocketServ		
       
   914 			COMMAND		RSocketServData	Connect		
       
   915 			COMMAND		CBluetoothPhysicalLinksData	NewL		BT-USER-PhysicalLinks-PublicApi-Active-0011-0001command5NewL
       
   916 			COMMAND		CBluetoothPhysicalLinksData	Disconnect		BT-USER-PhysicalLinks-PublicApi-Active-0011-0001command6Disconnect
       
   917 			OUTSTANDING	
       
   918 			COMMAND		CBluetoothPhysicalLinksData	~		
       
   919 			COMMAND		RSocketServData	Close		
       
   920 	END_TEST_BLOCK
       
   921 
       
   922 END_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-Master-0011
       
   923 
       
   924 
       
   925 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini RetrieveExecutionResultPhysicalLinksPassiveSlave
       
   926 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StopTDService
       
   927 RUN_TEST_STEP -1 UCCControlTE RunCommand \bluetooth\user\UccControlChannelConfig.ini StopSyncService
       
   928