@@ -87,8 +87,7 @@ void OnixSource::initializeDevices(bool updateStreamInfo)
8787	}
8888	oni_set_opt (ctx, ONIX_OPT_PASSTHROUGH, &val, sizeof (val));
8989
90- 	val = 1 ;
91- 	oni_set_opt (ctx, ONI_OPT_RESET, &val, sizeof (val));
90+ 	context.issueReset ();
9291
9392	//  Examine device table
9493	size_t  num_devs_sz = sizeof (num_devs);
@@ -138,7 +137,6 @@ void OnixSource::initializeDevices(bool updateStreamInfo)
138137	static  const  String probeLetters = " ABCDEFGHI"  ;
139138	const  int  bufferSizeInSeconds = 10 ;
140139	int  npxProbeIdx = 0 ;
141- 	int  bnoIdx = 0 ;
142140
143141	for  (size_t  dev_idx = 0 ; dev_idx < num_devs; dev_idx++)
144142	{
@@ -176,7 +174,7 @@ void OnixSource::initializeDevices(bool updateStreamInfo)
176174		}
177175		else  if  (devices[dev_idx].id  == ONIX_BNO055)
178176		{
179- 			auto  bno = std::make_unique<Bno055>(" BNO- "  +  String::charToString (probeLetters[bnoIdx]) , devices[dev_idx].idx , ctx);
177+ 			auto  bno = std::make_unique<Bno055>(" BNO055 "  , devices[dev_idx].idx , ctx);
180178
181179			int  result = bno->configureDevice ();
182180
@@ -189,8 +187,6 @@ void OnixSource::initializeDevices(bool updateStreamInfo)
189187			bno->addSourceBuffers (sourceBuffers);
190188
191189			sources.add (bno.release ());
192- 
193- 			bnoIdx++;
194190		}
195191		else  if  (devices[dev_idx].id  == ONIX_DS90UB9RAW)
196192		{
@@ -225,8 +221,7 @@ void OnixSource::initializeDevices(bool updateStreamInfo)
225221		}
226222	}
227223
228- 	val = 1 ;
229- 	oni_set_opt (ctx, ONI_OPT_RESET, &val, sizeof (val));
224+ 	context.issueReset ();
230225
231226	oni_size_t  frame_size = 0 ;
232227	size_t  frame_size_sz = sizeof (frame_size);
@@ -490,9 +485,7 @@ bool OnixSource::stopAcquisition()
490485			return  false ;
491486		}
492487
493- 		uint32_t  val = 1 ;
494- 		oni_set_opt (context.get (), ONI_OPT_RESET, &val, sizeof (val));
495- 		oni_set_opt (context.get (), ONI_OPT_BLOCKREADSIZE, &block_read_size, sizeof (block_read_size));
488+ 		context.issueReset ();
496489	}
497490
498491	for  (auto  source : sources)
0 commit comments