On Thu, 2009-05-21 at 09:15 +0200, Pablo Martí Gamboa wrote: > > > 2009/5/21 Dan Williams <[email protected]> > On Wed, 2009-05-20 at 10:23 +0200, Pablo Martí Gamboa wrote: > > Hi all, > > > > I've just been bitten by a small bug in src/nm-gsm-device.c > +443: > > > > const char *responses[] = { "+CREG: 0,0", "+CREG: 0,1", > "+CREG: 0,2", > > "+CREG: 0,3", "+CREG: 0,5", NULL }; > > > > > > If an external implementation has send '+CREG=1' those > terminators > > won't work. I think that you should just check the last part > of the > > +CREG response. > > > What would the response & terminator look like in that case? > Not quite > sure I follow. > > Something along the lines of what is done in ModemManager: > if (g_str_has_prefix (response->str, "+CREG: ")) { > int unsolicited, stat; > sscanf (response->str + 7, "%d,%d", &unsolicited, &stat); > .... > switch(stat) { > case 5: break; > case 4: break; > .... > } > }
Right, but I meant what is the exact response that's screwing up NM here on 0.7 branch? In 0.7 we do need to match the full response, otherwise we might match some other unsolicited response the modem sends, instead of CREG. Dan _______________________________________________ NetworkManager-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/networkmanager-list
