helpers: add generic response stripping function
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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 */
|
||||
|
||||
|
Reference in New Issue
Block a user