bluetoothapitest/bluetoothsvs/T_BTUserAPI/scripts/BT-USER-PhysicalLinks-PublicApi-Passive-Slave.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	T_BTUserAPI	-SharedData
       
    34 DELAY		500
       
    35 
       
    36 // ****************************************************************************
       
    37 // CBluetoothPhysicalLinks
       
    38 // ****************************************************************************	
       
    39 // Connected
       
    40 
       
    41 START_TESTCASE	BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0001
       
    42 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0001
       
    43 //! @SYMAPI						CBluetoothSocket, MBluetoothSocketNotifier, TBTDevAddr, RHostResolver, TL2CAPSockAddr
       
    44 //! @SYMTestCaseDesc			Set up a Bluetooth endpoint and accept and verify data
       
    45 //!								Uses API elements: 	NewL()1, Bind(), listen()1, and NewL()4 from CBluetoothSocket
       
    46 //!													HandleAcceptCompleteL() and HandleShutdownCompleteL() from MBluetoothSocketNotifier
       
    47 //!													TBTDevAddr() from TBTDevAddr
       
    48 //!													Open() and SetHostName() from RHostResolver
       
    49 //!													TL2CAPSockAddr(), SetFamily() and SetPort() from TL2CAPSockAddr
       
    50 //! @SYMTestActions				Wait for master to order start
       
    51 //!								1. Create and start a session on the socket server
       
    52 //!								2. Create a CBluetoothSocket using the NewL()1 (Standard constructor)
       
    53 //!								3. Create an TL2CAPSockAddr object
       
    54 //!								4. Set the Family to Bluetooth (257)
       
    55 //!								5. Set the port to the one matching the protocol to use
       
    56 //!								6. Use the Bind method of the CBluetoothSocket to bind the socket using the TL2CAPSockAddr object
       
    57 //!								7. Call the listen()1 method of the CBluetoothSocket object
       
    58 //!								8. Create a new empty CBluetoothSocket using NewL()4
       
    59 //!								9. Create an TBTDevAddr object (slave)
       
    60 //!								10. Create and initialise an RHostResolver
       
    61 //!								11. Set Hostname (SlaveDevice) of the device
       
    62 //!								12. Call Accept()1 on the old CBluetoothSocket object with the new as argument
       
    63 //!								13. HandleAcceptCompleteL gets called when accept is completed, verify that there is no error
       
    64 //!								14. Do socket cleanup by calling Shutdown()1
       
    65 //!								15. HandleShutdownCompleteL gets called verify error code
       
    66 //!								16. delete CBluetoothSocket object
       
    67 //!
       
    68 //! @SYMTestStatus				Implemented
       
    69 //! @SYMTestPriority			High
       
    70 //! @SYMTestExpectedResults		Bluetooth endpoint set up successfully
       
    71 //! @SYMTestType				CIT
       
    72 
       
    73 	START_TEST_BLOCK	100	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Passive-Slave.ini
       
    74 			SHARED_ACTIVE_SCHEDULER
       
    75 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
    76 			CREATE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
    77 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSessionSocket	
       
    78 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
    79 			COMMAND		CBluetoothSocket1	NewL		BT-USER-PhysicalLinks-PublicApi-Passive-0001-0001command3NewL
       
    80 			COMMAND		TL2CAPSockAddr1	TL2CAPSockAddr		
       
    81 			COMMAND		TL2CAPSockAddr1	SetFamily		BT-USER-PhysicalLinks-PublicApi-Passive-0001-0001command6SetFamily
       
    82 			COMMAND		TL2CAPSockAddr1	SetPort		BT-USER-PhysicalLinks-PublicApi-Passive-0001-0001command7SetPort
       
    83 			COMMAND		CBluetoothSocket1	Bind		BT-USER-PhysicalLinks-PublicApi-Passive-0001-0001command9Bind
       
    84 			COMMAND		CBluetoothSocket1	Listen		BT-USER-PhysicalLinks-PublicApi-Passive-0001-0001command10Listen
       
    85 			COMMAND		CBluetoothSessionSocket	SetRsocketServerFromCBTSocket		BT-USER-PhysicalLinks-PublicApi-Passive-0001-0001command12SetRsocketServerFromCBTSocket
       
    86 			COMMAND		CBluetoothSessionSocket	NewL		BT-USER-PhysicalLinks-PublicApi-Passive-0001-0001command13NewL
       
    87 			STORE	CBluetoothSocket1	
       
    88 			STORE	CBluetoothSessionSocket	
       
    89 			STORE_ACTIVE_SCHEDULER
       
    90 	END_TEST_BLOCK
       
    91 
       
    92 	START_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0001-0002
       
    93 	START_TEST_BLOCK	100	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Passive-Slave.ini
       
    94 			SHARED_ACTIVE_SCHEDULER
       
    95 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
    96 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSessionSocket	
       
    97 			CREATE_OBJECT	TBTDevAddr	TBTDevAddrLocal	
       
    98 			COMMAND		TBTDevAddrLocal	Construct		
       
    99 			COMMAND		TBTDevAddrLocal	OpenHostResolver		BT-USER-PhysicalLinks-PublicApi-Passive-0001-0002command3OpenHostResolver
       
   100 			COMMAND		TBTDevAddrLocal	SetHostNameL		BT-USER-PhysicalLinks-PublicApi-Passive-0001-0002command4SetHostNameL
       
   101 			COMMAND		TBTDevAddrLocal	SetDiscoverable		
       
   102 			STORE	CBluetoothSocket1	
       
   103 			STORE	CBluetoothSessionSocket	
       
   104 			STORE	TBTDevAddrLocal
       
   105 			STORE_ACTIVE_SCHEDULER
       
   106 	END_TEST_BLOCK
       
   107 	END_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0001-0002
       
   108 
       
   109 	START_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0001-0003
       
   110 	START_TEST_BLOCK	300	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Passive-Slave.ini
       
   111 			SHARED_ACTIVE_SCHEDULER
       
   112 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   113 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSessionSocket	
       
   114 			COMMAND		CBluetoothSocket1	Accept		BT-USER-PhysicalLinks-PublicApi-Passive-0001-0003command2Accept
       
   115 			OUTSTANDING	
       
   116 			COMMAND		CBluetoothSessionSocket	Shutdown	BT-USER-PhysicalLinks-PublicApi-Passive-0001-0003command3Shutdown
       
   117 			OUTSTANDING
       
   118 			COMMAND		CBluetoothSessionSocket	~	
       
   119 			COMMAND		CBluetoothSocket1	Shutdown	BT-USER-PhysicalLinks-PublicApi-Passive-0001-0003command4Shutdown
       
   120 			OUTSTANDING	
       
   121 			COMMAND		CBluetoothSocket1	~		
       
   122 			COMMAND		CBluetoothSocket1	RSocketServerClose		
       
   123 	END_TEST_BLOCK
       
   124 	END_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0001-0003
       
   125 
       
   126 END_TESTCASE	BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0001
       
   127 
       
   128 
       
   129 START_TESTCASE	BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0002
       
   130 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0002
       
   131 //! @SYMAPI						CBluetoothSocket, MBluetoothSocketNotifier, TL2CAPSockAddr
       
   132 //! @SYMTestCaseDesc			Set up a Bluetooth endpoint and accept and verify data
       
   133 //!								Uses API elements: 	NewL()1, Bind(), listen()1, and NewL()4 from CBluetoothSocket
       
   134 //!													HandleAcceptCompleteL() and HandleShutdownCompleteL() from MBluetoothSocketNotifier
       
   135 //!													TL2CAPSockAddr(), SetFamily() and SetPort() from TL2CAPSockAddr
       
   136 //! @SYMTestActions				Wait for master to order start
       
   137 //!								1. Create and start a session on the socket server
       
   138 //!								2. Create a CBluetoothSocket using the NewL()1 (Standard constructor)
       
   139 //!								3. Create an TL2CAPSockAddr object
       
   140 //!								4. Set the Family to Bluetooth (257)
       
   141 //!								5. Set the port to the one matching the protocol to use
       
   142 //!								6. Use the Bind method of the CBluetoothSocket to bind the socket using the TL2CAPSockAddr object
       
   143 //!								7. Call the listen()1 method of the CBluetoothSocket object
       
   144 //!								8. Create a new empty CBluetoothSocket using NewL()4
       
   145 //!								9. Call Accept()1 on the old CBluetoothSocket object with the new as argument
       
   146 //!								10. HandleAcceptCompleteL gets called when accept is completed, verify that there is no error
       
   147 //!								11. Do socket cleanup by calling Shutdown()1
       
   148 //!								12. HandleShutdownCompleteL gets called verify error code
       
   149 //!								13. delete CBluetoothSocket object
       
   150 //!
       
   151 //! @SYMTestStatus				Implemented
       
   152 //! @SYMTestPriority			High
       
   153 //! @SYMTestExpectedResults		Bluetooth endpoint set up successfully
       
   154 //! @SYMTestType				CIT
       
   155 
       
   156 	START_TEST_BLOCK	100	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Passive-Slave.ini
       
   157 			SHARED_ACTIVE_SCHEDULER
       
   158 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   159 			CREATE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   160 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSessionSocket	
       
   161 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
   162 			COMMAND		CBluetoothSocket1	NewL		BT-USER-PhysicalLinks-PublicApi-Passive-0002-0001command3NewL
       
   163 			COMMAND		TL2CAPSockAddr1	TL2CAPSockAddr		
       
   164 			COMMAND		TL2CAPSockAddr1	SetFamily		BT-USER-PhysicalLinks-PublicApi-Passive-0002-0001command6SetFamily
       
   165 			COMMAND		TL2CAPSockAddr1	SetPort		BT-USER-PhysicalLinks-PublicApi-Passive-0002-0001command7SetPort
       
   166 			COMMAND		CBluetoothSocket1	Bind		BT-USER-PhysicalLinks-PublicApi-Passive-0002-0001command9Bind
       
   167 			COMMAND		CBluetoothSocket1	Listen		BT-USER-PhysicalLinks-PublicApi-Passive-0002-0001command10Listen
       
   168 			COMMAND		CBluetoothSessionSocket	SetRsocketServerFromCBTSocket		BT-USER-PhysicalLinks-PublicApi-Passive-0002-0001command12SetRsocketServerFromCBTSocket
       
   169 			COMMAND		CBluetoothSessionSocket	NewL		BT-USER-PhysicalLinks-PublicApi-Passive-0002-0001command13NewL
       
   170 			STORE	CBluetoothSocket1	
       
   171 			STORE	CBluetoothSessionSocket	
       
   172 			STORE_ACTIVE_SCHEDULER
       
   173 	END_TEST_BLOCK
       
   174 
       
   175 	START_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0002-0002
       
   176 	START_TEST_BLOCK	300	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Passive-Slave.ini
       
   177 			SHARED_ACTIVE_SCHEDULER
       
   178 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   179 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSessionSocket	
       
   180 			COMMAND		CBluetoothSocket1	Accept		BT-USER-PhysicalLinks-PublicApi-Passive-0002-0002command2Accept
       
   181 			OUTSTANDING
       
   182 			COMMAND		CBluetoothSessionSocket	Shutdown	BT-USER-PhysicalLinks-PublicApi-Passive-0002-0002command3Shutdown
       
   183 			OUTSTANDING
       
   184 			COMMAND		CBluetoothSessionSocket	~	
       
   185 			COMMAND		CBluetoothSocket1	Shutdown	BT-USER-PhysicalLinks-PublicApi-Passive-0002-0002command4Shutdown
       
   186 			OUTSTANDING	
       
   187 			COMMAND		CBluetoothSocket1	~		
       
   188 			COMMAND		CBluetoothSocket1	RSocketServerClose		
       
   189 	END_TEST_BLOCK
       
   190 	END_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0002-0002
       
   191 
       
   192 END_TESTCASE	BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0002
       
   193 
       
   194 
       
   195 START_TESTCASE	BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0003
       
   196 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0003
       
   197 //! @SYMAPI						CBluetoothSocket, MBluetoothSocketNotifier, TBTDevAddr, RHostResolver, TL2CAPSockAddr
       
   198 //! @SYMTestCaseDesc			Set up a Bluetooth endpoint and accept and verify data
       
   199 //! @SYMAPI						CBluetoothSocket, MBluetoothSocketNotifier, TL2CAPSockAddr
       
   200 //! @SYMTestCaseDesc			Set up a Bluetooth endpoint and accept and verify data
       
   201 //!								Uses API elements: 	NewL()1, Bind(), listen()1, and NewL()4 from CBluetoothSocket
       
   202 //!													HandleAcceptCompleteL() and HandleShutdownCompleteL() from MBluetoothSocketNotifier
       
   203 //!													TL2CAPSockAddr(), SetFamily() and SetPort() from TL2CAPSockAddr
       
   204 //! @SYMTestActions				Wait for master to order start
       
   205 //!								1. Create and start a session on the socket server
       
   206 //!								2. Create a CBluetoothSocket using the NewL()1 (Standard constructor)
       
   207 //!								3. Create an TL2CAPSockAddr object
       
   208 //!								4. Set the Family to Bluetooth (257)
       
   209 //!								5. Set the port to the one matching the protocol to use
       
   210 //!								6. Use the Bind method of the CBluetoothSocket to bind the socket using the TL2CAPSockAddr object
       
   211 //!								7. Call the listen()1 method of the CBluetoothSocket object
       
   212 //!								8. Create a new empty CBluetoothSocket using NewL()4
       
   213 //!								9. Call Accept()1 on the old CBluetoothSocket object with the new as argument
       
   214 //!								10. HandleAcceptCompleteL gets called when accept is completed, verify that there is no error
       
   215 //!								11. Do socket cleanup by calling Shutdown()1
       
   216 //!								12. HandleShutdownCompleteL gets called verify error code
       
   217 //!								13. delete CBluetoothSocket object
       
   218 //!
       
   219 //! @SYMTestStatus				Implemented
       
   220 //! @SYMTestPriority			High
       
   221 //! @SYMTestExpectedResults		Bluetooth endpoint set up successfully
       
   222 //! @SYMTestType				CIT
       
   223 
       
   224 	START_TEST_BLOCK	100	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Passive-Slave.ini
       
   225 			SHARED_ACTIVE_SCHEDULER
       
   226 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   227 			CREATE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   228 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSessionSocket	
       
   229 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
   230 			COMMAND		CBluetoothSocket1	NewL		BT-USER-PhysicalLinks-PublicApi-Passive-0003-0001command3NewL
       
   231 			COMMAND		TL2CAPSockAddr1	TL2CAPSockAddr		
       
   232 			COMMAND		TL2CAPSockAddr1	SetFamily		BT-USER-PhysicalLinks-PublicApi-Passive-0003-0001command6SetFamily
       
   233 			COMMAND		TL2CAPSockAddr1	SetPort		BT-USER-PhysicalLinks-PublicApi-Passive-0003-0001command7SetPort
       
   234 			COMMAND		CBluetoothSocket1	Bind		BT-USER-PhysicalLinks-PublicApi-Passive-0003-0001command9Bind
       
   235 			COMMAND		CBluetoothSocket1	Listen		BT-USER-PhysicalLinks-PublicApi-Passive-0003-0001command10Listen
       
   236 			COMMAND		CBluetoothSessionSocket	SetRsocketServerFromCBTSocket		BT-USER-PhysicalLinks-PublicApi-Passive-0003-0001command12SetRsocketServerFromCBTSocket
       
   237 			COMMAND		CBluetoothSessionSocket	NewL		BT-USER-PhysicalLinks-PublicApi-Passive-0003-0001command13NewL
       
   238 			STORE	CBluetoothSocket1	
       
   239 			STORE	CBluetoothSessionSocket	
       
   240 			STORE_ACTIVE_SCHEDULER
       
   241 	END_TEST_BLOCK
       
   242 
       
   243 	START_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0003-0002
       
   244 	START_TEST_BLOCK	300	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Passive-Slave.ini
       
   245 			SHARED_ACTIVE_SCHEDULER
       
   246 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   247 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSessionSocket	
       
   248 			COMMAND		CBluetoothSocket1	Accept		BT-USER-PhysicalLinks-PublicApi-Passive-0003-0002command2Accept
       
   249 			OUTSTANDING
       
   250 			COMMAND		CBluetoothSessionSocket	Shutdown	BT-USER-PhysicalLinks-PublicApi-Passive-0003-0002command3Shutdown
       
   251 			OUTSTANDING
       
   252 			COMMAND		CBluetoothSessionSocket	~		
       
   253 			COMMAND		CBluetoothSocket1	Shutdown	BT-USER-PhysicalLinks-PublicApi-Passive-0003-0002command4Shutdown
       
   254 			OUTSTANDING
       
   255 			COMMAND		CBluetoothSocket1	~		
       
   256 			COMMAND		CBluetoothSocket1	RSocketServerClose	
       
   257 	END_TEST_BLOCK
       
   258 	END_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0003-0002
       
   259 
       
   260 END_TESTCASE	BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0003
       
   261 
       
   262 
       
   263 START_TESTCASE	BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0004
       
   264 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0004
       
   265 //! @SYMAPI						CBluetoothSocket, MBluetoothSocketNotifier, TL2CAPSockAddr
       
   266 //! @SYMTestCaseDesc			Set up a Bluetooth endpoint and accept and verify data
       
   267 //!								Uses API elements: 	NewL()1, Bind(), listen()1, and NewL()4 from CBluetoothSocket
       
   268 //!													HandleAcceptCompleteL() and HandleShutdownCompleteL() from MBluetoothSocketNotifier
       
   269 //!													TL2CAPSockAddr(), SetFamily() and SetPort() from TL2CAPSockAddr
       
   270 //! @SYMTestActions				Wait for master to order start
       
   271 //!								1. Create and start a session on the socket server
       
   272 //!								2. Create a CBluetoothSocket using the NewL()1 (Standard constructor)
       
   273 //!								3. Create an TL2CAPSockAddr object
       
   274 //!								4. Set the Family to Bluetooth (257)
       
   275 //!								5. Set the port to the one matching the protocol to use
       
   276 //!								6. Use the Bind method of the CBluetoothSocket to bind the socket using the TL2CAPSockAddr object
       
   277 //!								7. Call the listen()1 method of the CBluetoothSocket object
       
   278 //!								8. Create a new empty CBluetoothSocket using NewL()4
       
   279 //!								9. Call Accept()1 on the old CBluetoothSocket object with the new as argument
       
   280 //!								10. HandleAcceptCompleteL gets called when accept is completed, verify that there is no error
       
   281 //!								11. Do socket cleanup by calling Shutdown()1
       
   282 //!								12. HandleShutdownCompleteL gets called verify error code
       
   283 //!								13. delete CBluetoothSocket object
       
   284 //!
       
   285 //! @SYMTestStatus				Implemented
       
   286 //! @SYMTestPriority			High
       
   287 //! @SYMTestExpectedResults		Bluetooth endpoint set up successfully
       
   288 //! @SYMTestType				CIT
       
   289 
       
   290 	START_TEST_BLOCK	100	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Passive-Slave.ini
       
   291 			SHARED_ACTIVE_SCHEDULER
       
   292 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   293 			CREATE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   294 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSessionSocket	
       
   295 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
   296 			COMMAND		CBluetoothSocket1	NewL		BT-USER-PhysicalLinks-PublicApi-Passive-0004-0001command3NewL
       
   297 			COMMAND		TL2CAPSockAddr1	TL2CAPSockAddr		
       
   298 			COMMAND		TL2CAPSockAddr1	SetFamily		BT-USER-PhysicalLinks-PublicApi-Passive-0004-0001command6SetFamily
       
   299 			COMMAND		TL2CAPSockAddr1	SetPort		BT-USER-PhysicalLinks-PublicApi-Passive-0004-0001command7SetPort
       
   300 			COMMAND		CBluetoothSocket1	Bind		BT-USER-PhysicalLinks-PublicApi-Passive-0004-0001command9Bind
       
   301 			COMMAND		CBluetoothSocket1	Listen		BT-USER-PhysicalLinks-PublicApi-Passive-0004-0001command10Listen
       
   302 			COMMAND		CBluetoothSessionSocket	SetRsocketServerFromCBTSocket		BT-USER-PhysicalLinks-PublicApi-Passive-0004-0001command12SetRsocketServerFromCBTSocket
       
   303 			COMMAND		CBluetoothSessionSocket	NewL		BT-USER-PhysicalLinks-PublicApi-Passive-0004-0001command13NewL
       
   304 			STORE	CBluetoothSocket1	
       
   305 			STORE	CBluetoothSessionSocket	
       
   306 			STORE_ACTIVE_SCHEDULER
       
   307 	END_TEST_BLOCK
       
   308 
       
   309 	START_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0004-0002
       
   310 	START_TEST_BLOCK	300	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Passive-Slave.ini
       
   311 			SHARED_ACTIVE_SCHEDULER
       
   312 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   313 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSessionSocket	
       
   314 			COMMAND		CBluetoothSocket1	Accept		BT-USER-PhysicalLinks-PublicApi-Passive-0004-0002command2Accept
       
   315 			OUTSTANDING
       
   316 			COMMAND		CBluetoothSessionSocket	Shutdown	BT-USER-PhysicalLinks-PublicApi-Passive-0004-0002command3Shutdown
       
   317 			OUTSTANDING
       
   318 			COMMAND		CBluetoothSessionSocket	~	
       
   319 			COMMAND		CBluetoothSocket1	Shutdown	BT-USER-PhysicalLinks-PublicApi-Passive-0004-0002command4Shutdown
       
   320 			OUTSTANDING
       
   321 			COMMAND		CBluetoothSocket1	~		
       
   322 			COMMAND		CBluetoothSocket1	RSocketServerClose	
       
   323 	END_TEST_BLOCK
       
   324 	END_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0004-0002
       
   325 
       
   326 END_TESTCASE	BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0004
       
   327 
       
   328 
       
   329 START_TESTCASE	BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0005
       
   330 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0005
       
   331 //! @SYMAPI						CBluetoothSocket, MBluetoothSocketNotifier, TL2CAPSockAddr
       
   332 //! @SYMTestCaseDesc			Set up a Bluetooth endpoint and accept and verify data
       
   333 //!								Uses API elements: 	NewL()1, Bind(), listen()1, and NewL()4 from CBluetoothSocket
       
   334 //!													HandleAcceptCompleteL() and HandleShutdownCompleteL() from MBluetoothSocketNotifier
       
   335 //!													TL2CAPSockAddr(), SetFamily() and SetPort() from TL2CAPSockAddr
       
   336 //! @SYMTestActions				Wait for master to order start
       
   337 //!								1. Create and start a session on the socket server
       
   338 //!								2. Create a CBluetoothSocket using the NewL()1 (Standard constructor)
       
   339 //!								3. Create an TL2CAPSockAddr object
       
   340 //!								4. Set the Family to Bluetooth (257)
       
   341 //!								5. Set the port to the one matching the protocol to use
       
   342 //!								6. Use the Bind method of the CBluetoothSocket to bind the socket using the TL2CAPSockAddr object
       
   343 //!								7. Call the listen()1 method of the CBluetoothSocket object
       
   344 //!								8. Create a new empty CBluetoothSocket using NewL()4
       
   345 //!								9. Call Accept()1 on the old CBluetoothSocket object with the new as argument
       
   346 //!								10. HandleAcceptCompleteL gets called when accept is completed, verify that there is no error
       
   347 //!								11. Do socket cleanup by calling Shutdown()1
       
   348 //!								12. HandleShutdownCompleteL gets called verify error code
       
   349 //!								13. delete CBluetoothSocket object
       
   350 //!
       
   351 //! @SYMTestStatus				Implemented
       
   352 //! @SYMTestPriority			High
       
   353 //! @SYMTestExpectedResults		Bluetooth endpoint set up successfully
       
   354 //! @SYMTestType				CIT
       
   355 
       
   356 	START_TEST_BLOCK	100	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Passive-Slave.ini
       
   357 			SHARED_ACTIVE_SCHEDULER
       
   358 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   359 			CREATE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   360 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSessionSocket	
       
   361 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
   362 			COMMAND		CBluetoothSocket1	NewL		BT-USER-PhysicalLinks-PublicApi-Passive-0005-0001command3NewL
       
   363 			COMMAND		TL2CAPSockAddr1	TL2CAPSockAddr		
       
   364 			COMMAND		TL2CAPSockAddr1	SetFamily		BT-USER-PhysicalLinks-PublicApi-Passive-0005-0001command6SetFamily
       
   365 			COMMAND		TL2CAPSockAddr1	SetPort		BT-USER-PhysicalLinks-PublicApi-Passive-0005-0001command7SetPort
       
   366 			COMMAND		CBluetoothSocket1	Bind		BT-USER-PhysicalLinks-PublicApi-Passive-0005-0001command9Bind
       
   367 			COMMAND		CBluetoothSocket1	Listen		BT-USER-PhysicalLinks-PublicApi-Passive-0005-0001command10Listen
       
   368 			COMMAND		CBluetoothSessionSocket	SetRsocketServerFromCBTSocket		BT-USER-PhysicalLinks-PublicApi-Passive-0005-0001command12SetRsocketServerFromCBTSocket
       
   369 			COMMAND		CBluetoothSessionSocket	NewL		BT-USER-PhysicalLinks-PublicApi-Passive-0005-0001command13NewL
       
   370 			STORE	CBluetoothSocket1	
       
   371 			STORE	CBluetoothSessionSocket	
       
   372 			STORE_ACTIVE_SCHEDULER
       
   373 	END_TEST_BLOCK
       
   374 
       
   375 	START_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0005-0002
       
   376 	START_TEST_BLOCK	300	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Passive-Slave.ini
       
   377 			SHARED_ACTIVE_SCHEDULER
       
   378 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   379 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSessionSocket	
       
   380 			COMMAND		CBluetoothSocket1	Accept		BT-USER-PhysicalLinks-PublicApi-Passive-0005-0002command2Accept
       
   381 			OUTSTANDING
       
   382 			COMMAND		CBluetoothSessionSocket	Shutdown	BT-USER-PhysicalLinks-PublicApi-Passive-0005-0002command3Shutdown
       
   383 			OUTSTANDING
       
   384 			COMMAND		CBluetoothSessionSocket	~		
       
   385 			COMMAND		CBluetoothSocket1	Shutdown	BT-USER-PhysicalLinks-PublicApi-Passive-0005-0002command4Shutdown
       
   386 			OUTSTANDING	
       
   387 			COMMAND		CBluetoothSocket1	~		
       
   388 			COMMAND		CBluetoothSocket1	RSocketServerClose
       
   389 	END_TEST_BLOCK
       
   390 	END_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0005-0002
       
   391 
       
   392 END_TESTCASE	BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0005
       
   393 
       
   394 
       
   395 START_TESTCASE	BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0006
       
   396 //! @SYMTestCaseID				BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0006
       
   397 //! @SYMAPI						CBluetoothSocket, MBluetoothSocketNotifier, TL2CAPSockAddr
       
   398 //! @SYMTestCaseDesc			Set up a Bluetooth endpoint and accept and verify data
       
   399 //!								Uses API elements: 	NewL()1, Bind(), listen()1, and NewL()4 from CBluetoothSocket
       
   400 //!													HandleAcceptCompleteL() and HandleShutdownCompleteL() from MBluetoothSocketNotifier
       
   401 //!													TL2CAPSockAddr(), SetFamily() and SetPort() from TL2CAPSockAddr
       
   402 //! @SYMTestActions				Wait for master to order start
       
   403 //!								1. Create and start a session on the socket server
       
   404 //!								2. Create a CBluetoothSocket using the NewL()1 (Standard constructor)
       
   405 //!								3. Create an TL2CAPSockAddr object
       
   406 //!								4. Set the Family to Bluetooth (257)
       
   407 //!								5. Set the port to the one matching the protocol to use
       
   408 //!								6. Use the Bind method of the CBluetoothSocket to bind the socket using the TL2CAPSockAddr object
       
   409 //!								7. Call the listen()1 method of the CBluetoothSocket object
       
   410 //!								8. Create a new empty CBluetoothSocket using NewL()4
       
   411 //!								9. Call Accept()1 on the old CBluetoothSocket object with the new as argument
       
   412 //!								10. HandleAcceptCompleteL gets called when accept is completed, verify that there is no error
       
   413 //!								11. Do socket cleanup by calling Shutdown()1
       
   414 //!								12. HandleShutdownCompleteL gets called verify error code
       
   415 //!								13. delete CBluetoothSocket object
       
   416 //!
       
   417 //! @SYMTestStatus				Implemented
       
   418 //! @SYMTestPriority			High
       
   419 //! @SYMTestExpectedResults		Bluetooth endpoint set up successfully
       
   420 //! @SYMTestType				CIT
       
   421 
       
   422 	START_TEST_BLOCK	100	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Passive-Slave.ini
       
   423 			SHARED_ACTIVE_SCHEDULER
       
   424 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   425 			CREATE_OBJECT	TL2CAPSockAddr	TL2CAPSockAddr1	
       
   426 			CREATE_OBJECT	CBluetoothSocket	CBluetoothSessionSocket	
       
   427 			COMMAND		CBluetoothSocket1	RSocketServerConnect		
       
   428 			COMMAND		CBluetoothSocket1	NewL		BT-USER-PhysicalLinks-PublicApi-Passive-0006-0001command3NewL
       
   429 			COMMAND		TL2CAPSockAddr1	TL2CAPSockAddr		
       
   430 			COMMAND		TL2CAPSockAddr1	SetFamily		BT-USER-PhysicalLinks-PublicApi-Passive-0006-0001command6SetFamily
       
   431 			COMMAND		TL2CAPSockAddr1	SetPort		BT-USER-PhysicalLinks-PublicApi-Passive-0006-0001command7SetPort
       
   432 			COMMAND		CBluetoothSocket1	Bind		BT-USER-PhysicalLinks-PublicApi-Passive-0006-0001command9Bind
       
   433 			COMMAND		CBluetoothSocket1	Listen		BT-USER-PhysicalLinks-PublicApi-Passive-0006-0001command10Listen
       
   434 			COMMAND		CBluetoothSessionSocket	SetRsocketServerFromCBTSocket		BT-USER-PhysicalLinks-PublicApi-Passive-0006-0001command12SetRsocketServerFromCBTSocket
       
   435 			COMMAND		CBluetoothSessionSocket	NewL		BT-USER-PhysicalLinks-PublicApi-Passive-0006-0001command13NewL
       
   436 			STORE	CBluetoothSocket1	
       
   437 			STORE	CBluetoothSessionSocket	
       
   438 			STORE_ACTIVE_SCHEDULER
       
   439 	END_TEST_BLOCK
       
   440 
       
   441 	START_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0006-0002
       
   442 	START_TEST_BLOCK	300	T_BTUserAPI	\bluetooth\user\BT-USER-PhysicalLinks-PublicApi-Passive-Slave.ini
       
   443 			SHARED_ACTIVE_SCHEDULER
       
   444 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSocket1	
       
   445 			RESTORE_OBJECT	CBluetoothSocket	CBluetoothSessionSocket	
       
   446 			COMMAND		CBluetoothSocket1	Accept		BT-USER-PhysicalLinks-PublicApi-Passive-0006-0002command2Accept
       
   447 			OUTSTANDING
       
   448 			COMMAND		CBluetoothSessionSocket	Shutdown	BT-USER-PhysicalLinks-PublicApi-Passive-0006-0002command3Shutdown
       
   449 			OUTSTANDING
       
   450 			COMMAND		CBluetoothSessionSocket	~	
       
   451 			COMMAND		CBluetoothSocket1	Shutdown	BT-USER-PhysicalLinks-PublicApi-Passive-0006-0002command4Shutdown
       
   452 			OUTSTANDING
       
   453 			COMMAND		CBluetoothSocket1	~		
       
   454 			COMMAND		CBluetoothSocket1	RSocketServerClose	
       
   455 	END_TEST_BLOCK
       
   456 	END_SYNCHRONISED_TESTCASE BT-USER-PhysicalLinks-PublicApi-Active-0006-0002
       
   457 
       
   458 END_TESTCASE	BT-USER-PhysicalLinks-PublicApi-Passive-Slave-0006
       
   459 
       
   460 
       
   461 DELAY		500