44
55#include " noctx.hpp"
66
7- St20pHandler::St20pHandler (st_tests_context* ctx, FrameTestStrategy* sessionUserData ,
7+ St20pHandler::St20pHandler (st_tests_context* ctx, FrameTestStrategy* frameTestStrategy ,
88 st20p_tx_ops ops_tx, st20p_rx_ops ops_rx, bool create,
99 bool start)
10- : Handlers(ctx, sessionUserData ) {
10+ : Handlers(ctx, frameTestStrategy ) {
1111 if (ops_tx.name == nullptr && ops_rx.name == nullptr ) {
1212 fillSt20Ops ();
1313 ops_tx = sessionsOpsTx;
@@ -17,11 +17,11 @@ St20pHandler::St20pHandler(st_tests_context* ctx, FrameTestStrategy* sessionUser
1717 sessionsOpsRx = ops_rx;
1818 }
1919
20- EXPECT_TRUE (sessionUserData != nullptr );
21- if (!sessionUserData ) return ;
20+ EXPECT_TRUE (frameTestStrategy != nullptr );
21+ if (!frameTestStrategy ) return ;
2222
23- this ->sessionUserData = sessionUserData ;
24- sessionUserData ->parent = this ;
23+ this ->frameTestStrategy = frameTestStrategy ;
24+ frameTestStrategy ->parent = this ;
2525
2626 if (create) {
2727 createSession (ops_tx, ops_rx, start);
@@ -111,17 +111,17 @@ void St20pHandler::createSession(st20p_tx_ops ops_tx, st20p_rx_ops ops_rx, bool
111111 sessionsOpsTx = ops_tx;
112112 sessionsOpsRx = ops_rx;
113113
114- createSessionTx ();
115114 createSessionRx ();
115+ createSessionTx ();
116116
117117 if (start) {
118118 startSession ();
119119 }
120120}
121121
122122void St20pHandler::createSession (bool start) {
123- createSessionTx ();
124123 createSessionRx ();
124+ createSessionTx ();
125125
126126 if (start) {
127127 startSession ();
@@ -168,8 +168,8 @@ void St20pHandler::st20TxDefaultFunction(std::atomic<bool>& stopFlag) {
168168 ASSERT_EQ (frame->width , width);
169169 ASSERT_EQ (frame->height , height);
170170
171- if (sessionUserData ->enable_tx_modifier ) {
172- sessionUserData ->txTestFrameModifier (frame->addr , frameSize);
171+ if (frameTestStrategy ->enable_tx_modifier ) {
172+ frameTestStrategy ->txTestFrameModifier (frame->addr , frameSize);
173173 }
174174
175175 frame->data_size = frameSize;
@@ -201,28 +201,29 @@ void St20pHandler::st20RxDefaultFunction(std::atomic<bool>& stopFlag) {
201201 ASSERT_EQ (frame->height , height);
202202 ASSERT_GE (frame->data_size , frameSize);
203203
204- if (sessionUserData ->enable_rx_modifier ) {
205- sessionUserData ->rxTestFrameModifier (frame->addr , frame->data_size );
204+ if (frameTestStrategy ->enable_rx_modifier ) {
205+ frameTestStrategy ->rxTestFrameModifier (frame->addr , frame->data_size );
206206 }
207207
208208 st20p_rx_put_frame (handle, frame);
209209 }
210210}
211211
212- void St20pHandler::startSession () {
213- Handlers::startSession (
214- {[this ](std::atomic<bool >& stopFlag) { this ->st20TxDefaultFunction (stopFlag); },
215- [this ](std::atomic<bool >& stopFlag) { this ->st20RxDefaultFunction (stopFlag); }});
216- }
217212
218213void St20pHandler::startSessionTx () {
219214 Handlers::startSession (
220- {[this ](std::atomic<bool >& stopFlag) { this ->st20TxDefaultFunction (stopFlag); }});
221- }
222-
215+ {[this ](std::atomic<bool >& stopFlag) { this ->st20TxDefaultFunction (stopFlag); }});
216+ }
217+
223218void St20pHandler::startSessionRx () {
224219 Handlers::startSession (
225- {[this ](std::atomic<bool >& stopFlag) { this ->st20RxDefaultFunction (stopFlag); }});
220+ {[this ](std::atomic<bool >& stopFlag) { this ->st20RxDefaultFunction (stopFlag); }});
221+ }
222+
223+ void St20pHandler::startSession () {
224+ startSessionRx ();
225+ sleep (1 );
226+ startSessionTx ();
226227}
227228
228229void St20pHandler::startSession (
0 commit comments