Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

reseting device unsing ANT_LIB / OSX

Rank

Total Posts: 13

Joined 2014-08-02

PM

Hello,
I just experienced a situation, where AssignChannel() failed. I've tried to reset the hardware after the serial channel was opened by calling ResetSystem(). But unfortunately this fails too.

The only thing that helped, was to pull the USB device (ANTUSB-m) out and in again.

How would could I reset the hardware to start with a freshly initialized USB device?

here's my code that tried to reset the device:

struct init
{
    init
()
        : 
serial_interface()
        , 
frame(&serial;_interface)
    
{
        
if ( !serial_interface.Init(baud_ratedevice_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


TIA,
Torsten      
Rank

Total Posts: 13

Joined 2014-08-02

PM

Is there any way to contact the developer of this library? Maybe he/she has an idea how to cope with this?      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

If it is not possible to communicate to the USB stick anymore, unfortunately there is little you can do at the library level to reset the hardware.

The following post may be helpful, although it is related to Windows
http://www.thisisant.com/forum/viewthread/3582/      
Rank

Total Posts: 13

Joined 2014-08-02

PM

Shouldn't we consider this to be a bug? Maybe this could be fixed? Maybe we could start a kickstarter to fix this?