mirror of git://git.sysmocom.de/ofono
modem: Add function for setting new driver type
This commit is contained in:
parent
5522df64fa
commit
67c6a01d46
|
@ -62,6 +62,7 @@ ofono_bool_t ofono_modem_get_online(struct ofono_modem *modem);
|
|||
ofono_bool_t ofono_modem_get_emergency_mode(struct ofono_modem *modem);
|
||||
|
||||
void ofono_modem_set_name(struct ofono_modem *modem, const char *name);
|
||||
void ofono_modem_set_driver(struct ofono_modem *modem, const char *type);
|
||||
|
||||
int ofono_modem_set_string(struct ofono_modem *modem,
|
||||
const char *key, const char *value);
|
||||
|
|
14
src/modem.c
14
src/modem.c
|
@ -1783,6 +1783,20 @@ void ofono_modem_set_name(struct ofono_modem *modem, const char *name)
|
|||
}
|
||||
}
|
||||
|
||||
void ofono_modem_set_driver(struct ofono_modem *modem, const char *type)
|
||||
{
|
||||
DBG("type: %s", type);
|
||||
|
||||
if (modem->driver)
|
||||
return;
|
||||
|
||||
if (strlen(type) > 16)
|
||||
return;
|
||||
|
||||
g_free(modem->driver_type);
|
||||
modem->driver_type = g_strdup(type);
|
||||
}
|
||||
|
||||
struct ofono_modem *ofono_modem_create(const char *name, const char *type)
|
||||
{
|
||||
struct ofono_modem *modem;
|
||||
|
|
Loading…
Reference in New Issue