helpers: add generic response stripping function

This commit is contained in:
Dan Williams
2010-03-19 10:57:01 -07:00
parent 6ca5765eb6
commit 4558df894b
2 changed files with 18 additions and 0 deletions

View File

@@ -430,3 +430,19 @@ mm_gsm_parse_creg_response (GMatchInfo *info,
return TRUE;
}
/*************************************************************************/
const char *
mm_strip_tag (const char *str, const char *cmd)
{
const char *p = str;
if (p) {
if (!strncmp (p, cmd, strlen (cmd)))
p += strlen (cmd);
while (isspace (*p))
p++;
}
return p;
}

View File

@@ -39,5 +39,7 @@ gboolean mm_gsm_parse_creg_response (GMatchInfo *info,
gboolean *out_cgreg,
GError **error);
const char *mm_strip_tag (const char *str, const char *cmd);
#endif /* MM_MODEM_HELPERS_H */