Skip to content

Commit

Permalink
[usb-moded] Make sure hw fallback mode always works
Browse files Browse the repository at this point in the history
Now in some rare case where auto-detect fails, or the connection info is always
wrong we can start usb_moded with a fallback option that will try to set
a connection no matter what and have it working.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Mar 9, 2015
1 parent cc9687c commit d036f86
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/usb_moded.c
Expand Up @@ -950,15 +950,12 @@ int main(int argc, char* argv[])
}
if( !hwal_init() )
{
log_crit("hwal init failed\n");
if(hw_fallback)
/* if hw_fallback is active we can live with a failed hwal_init */
if(!hw_fallback)
{
log_warning("Forcing USB state to connected always. ASK mode non functional!\n");
/* Since there will be no disconnect signals coming from hw the state should not change */
set_usb_connected(TRUE);
}
else
log_crit("hwal init failed\n");
goto EXIT;
}
}
#ifdef MEEGOLOCK
start_devicelock_listener();
Expand All @@ -982,6 +979,13 @@ int main(int argc, char* argv[])

send_supported_modes_signal();

if(hw_fallback)
{
log_warning("Forcing USB state to connected always. ASK mode non functional!\n");
/* Since there will be no disconnect signals coming from hw the state should not change */
set_usb_connected(TRUE);
}

/* init succesful, run main loop */
result = EXIT_SUCCESS;
g_main_loop_run(mainloop);
Expand Down

0 comments on commit d036f86

Please sign in to comment.