modem-helpers: add flow control udev tag parser
Add function for parsing the content of the udev tag ID_MM_TTY_FLOW_CONTROL.
This commit is contained in:

committed by
Dan Williams

parent
bc407a38d6
commit
a1c27bf89d
@@ -646,6 +646,25 @@ out:
|
|||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MMFlowControl
|
||||||
|
mm_parse_flow_control_tag (const gchar *flow_control_tag)
|
||||||
|
{
|
||||||
|
MMFlowControl flow_control;
|
||||||
|
|
||||||
|
if (g_strcmp0 ("xonxoff", flow_control_tag) == 0)
|
||||||
|
flow_control = MM_FLOW_CONTROL_XON_XOFF;
|
||||||
|
else if (g_strcmp0 ("rtscts", flow_control_tag) == 0)
|
||||||
|
flow_control = MM_FLOW_CONTROL_RTS_CTS;
|
||||||
|
else if (g_strcmp0 ("none", flow_control_tag) == 0)
|
||||||
|
flow_control = MM_FLOW_CONTROL_NONE;
|
||||||
|
else {
|
||||||
|
mm_warn ("Cannot parse flow control tag: '%s', setting as unknown", flow_control_tag);
|
||||||
|
flow_control = MM_FLOW_CONTROL_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
return flow_control;
|
||||||
|
}
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
/* +CREG: <stat> (GSM 07.07 CREG=1 unsolicited) */
|
/* +CREG: <stat> (GSM 07.07 CREG=1 unsolicited) */
|
||||||
|
@@ -112,6 +112,8 @@ typedef enum { /*< underscore_name=mm_flow_control >*/
|
|||||||
MMFlowControl mm_parse_ifc_test_response (const gchar *response,
|
MMFlowControl mm_parse_ifc_test_response (const gchar *response,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
MMFlowControl mm_parse_flow_control_tag (const gchar *flow_control);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* 3GPP specific helpers and utilities */
|
/* 3GPP specific helpers and utilities */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
Reference in New Issue
Block a user