core: add port type -> string conversion helper for debuggin messages
This commit is contained in:
@@ -46,6 +46,26 @@ typedef struct {
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
const char *
|
||||||
|
mm_port_type_to_name (MMPortType ptype)
|
||||||
|
{
|
||||||
|
switch (ptype) {
|
||||||
|
case MM_PORT_TYPE_PRIMARY:
|
||||||
|
return "primary";
|
||||||
|
case MM_PORT_TYPE_SECONDARY:
|
||||||
|
return "secondary";
|
||||||
|
case MM_PORT_TYPE_IGNORED:
|
||||||
|
return "ignored";
|
||||||
|
case MM_PORT_TYPE_QCDM:
|
||||||
|
return "QCDM";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return "(unknown)";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static GObject*
|
static GObject*
|
||||||
constructor (GType type,
|
constructor (GType type,
|
||||||
guint n_construct_params,
|
guint n_construct_params,
|
||||||
|
@@ -76,5 +76,7 @@ gboolean mm_port_get_connected (MMPort *self);
|
|||||||
|
|
||||||
void mm_port_set_connected (MMPort *self, gboolean connected);
|
void mm_port_set_connected (MMPort *self, gboolean connected);
|
||||||
|
|
||||||
|
const char * mm_port_type_to_name (MMPortType ptype);
|
||||||
|
|
||||||
#endif /* MM_PORT_H */
|
#endif /* MM_PORT_H */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user