lte: If method is NULL, return not implemented

This commit is contained in:
Denis Kenzior 2016-11-15 13:41:58 -06:00
parent 872c1a82f1
commit b8d6828388
1 changed files with 7 additions and 5 deletions

View File

@ -146,6 +146,12 @@ static DBusMessage *lte_set_default_apn(struct ofono_lte *lte,
DBusConnection *conn, DBusMessage *msg,
const char *apn)
{
if (lte->driver->set_default_attach_info == NULL)
return __ofono_error_not_implemented(msg);
if (lte->pending)
return __ofono_error_busy(msg);
if (strlen(apn) > OFONO_GPRS_MAX_APN_LENGTH)
return __ofono_error_invalid_format(msg);
@ -156,15 +162,11 @@ static DBusMessage *lte_set_default_apn(struct ofono_lte *lte,
if (is_valid_apn(apn) == FALSE && apn[0] != '\0')
return __ofono_error_invalid_format(msg);
if (lte->pending)
return __ofono_error_busy(msg);
lte->pending = dbus_message_ref(msg);
g_strlcpy(lte->pending_info.apn, apn, OFONO_GPRS_MAX_APN_LENGTH + 1);
if (lte->driver->set_default_attach_info)
lte->driver->set_default_attach_info(lte, &lte->pending_info,
lte->driver->set_default_attach_info(lte, &lte->pending_info,
lte_set_default_attach_info_cb, lte);
return NULL;