mal.cpp
int Mal::start_mal(bool quiet) {

    int timer=1, done = 0;
    char jcmd1[]="{\"action\":\"set_network_connection_mode\",\"args\":{\"mode\":0,\"ondemand_timeout\":2,\"manual_mode\":1}}";
    char jcmd2[]="{\"action\":\"set_wwan_allow_data_roaming\",\"args\":{\"enable\":1}}";

    if( !quiet ) printf( "\n");
    while( !done ) {
        if( send_mal_command(jcmd1, NULL, 0, false) < 0 ) {
            if( !quiet ) {
                printf( "Starting MAL interface. (%d)\r",timer++);
                fflush(stdout);
                }
            sleep(1);
            continue;
            }
        done = (send_mal_command(jcmd2, NULL, 0, false) == 0);
        }
    if( !quiet ) printf( "                                \r");
    return done;
}
//
// This function starts data service in the WNC M18Qx using the MAL manager.
//
// Inputs: NONE
//
// Returns:
//      will return <0 if an error occurs, otherwise 0.
This function starts data service in the WNC M18Qx using the MAL manager.
Inputs: NONE

will return <0 if an error occurs, otherwise 0.
This function starts data service in the WNC M18Qx using the MAL manager . Inputs : NONE will return <0 if an error occurs otherwise 0 .
int Mal::start_mal(bool quiet) {
    int timer=1, done = 0;
    char jcmd1[]="{\"action\":\"set_network_connection_mode\",\"args\":{\"mode\":0,\"ondemand_timeout\":2,\"manual_mode\":1}}";
    char jcmd2[]="{\"action\":\"set_wwan_allow_data_roaming\",\"args\":{\"enable\":1}}";
    if( !quiet ) printf( "\n");
    while( !done ) {
        if( send_mal_command(jcmd1, NULL, 0, false) < 0 ) {
            if( !quiet ) {
                printf( "Starting MAL interface. (%d)\r",timer++);
                fflush(stdout);
                }
            sleep(1);
            continue;
            }
        done = (send_mal_command(jcmd2, NULL, 0, false) == 0);
        }
    if( !quiet ) printf( "                                \r");
    return done;
}
int Mal :: start_mal ( bool quiet ) { int timer = 1 , done = 0 ; char jcmd1 [ ] = " \" \" \" \" \" \" \" \" \" \" \" \" " ; char jcmd2 [ ] = " \" \" \" \" \" \" \" \" " ; if ( ! quiet ) printf ( " \n " ) ; while ( ! done ) { if ( send_mal_command ( jcmd1 , NULL , 0 , false ) < 0 ) { if ( ! quiet ) { printf ( " \r " , timer ++ ) ; fflush ( stdout ) ; } sleep ( 1 ) ; continue ; } done = ( send_mal_command ( jcmd2 , NULL , 0 , false ) == 0 ) ; } if ( ! quiet ) printf ( " \r " ) ; return done ; }
This function starts data service in the WNC M18Qx using the MAL manager.
This function starts data service in the WNC M18Qx using the MAL manager .