10 years, 11 months ago.

VodafoneUSBModem doesn't tidy up after itself

I want to have the VodafoneUSBModem part of my code in a separate subroutine that gets called from the 'test' thread. This way each time I do a bit of communications, the VodafoneUSBModem connects and disconnects. The first call to the subroutine is fine and everything works as expected. The second call causes running lights of death.

To recreate, import VodafoneUSBModemHTTPClientTest and edit it as follows:

  1. change the line void test(void const*) to void Voda_routine(void)
  2. delete the while(1) { } at the end of this subroutine
  3. add this code below the Voda_routine subroutine (above main):

void test(void const*)
{
    int i = 0;
    while(1) {
        i++;
        printf("-------------------------------------------------------> Attempt %d: \n", i);
        Voda_routine();
        printf("-------------------------------------------------------> Success!\n");
        Thread::wait(5000);
    }
}

How can this be fixed, is it a bug?

Question relating to:

Be the first to answer this question.