You are here: Forum Home → ANT Developers Forums → ANT General Questions → Thread
struct init
{
init()
: serial_interface()
, frame(&serial;_interface)
{
if ( !serial_interface.Init(baud_rate, device_number) )
throw std::runtime_error("serial_interface.Init() failed!");
if ( !frame.Init() )
throw std::runtime_error("frame.Init() failed!");
serial_interface.SetCallback(&frame;);
if ( !serial_interface.Open() )
throw std::runtime_error("serial_interface.Open() failed!");
if ( !frame.ResetSystem(msg_timeout_ms) )
throw std::runtime_error("frame.ResetSystem() failed!");
}
init( const init& ) = delete;
DSISerialGeneric serial_interface;
DSIFramerANT frame;
};
init i;