diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2017-05-22 20:33:29 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2017-05-31 20:17:42 +0200 |
commit | aedeb3cbf4fa5857d7784b10d8b20cba798cc7ce (patch) | |
tree | 6baadca04749366a192b463d26623899141a6d53 | |
parent | ab46c9c70c41b14db2c216983bfa96194f272b5a (diff) | |
download | NetworkManager-aedeb3cbf4fa5857d7784b10d8b20cba798cc7ce.tar.gz |
clients: add support for Bluetooth NAP type
-rw-r--r-- | clients/cli/connections.c | 13 | ||||
-rw-r--r-- | clients/common/nm-meta-setting-desc.c | 4 | ||||
-rw-r--r-- | clients/common/nm-meta-setting-desc.h | 3 | ||||
-rw-r--r-- | man/nmcli.xml | 8 |
4 files changed, 15 insertions, 13 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 983a9587dd..f2f4adecf7 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -301,7 +301,7 @@ usage_connection_add (void) " [parent <ifname>]\n" " [p-key <IPoIB P_Key>]\n\n" " bluetooth: [addr <bluetooth address>]\n" - " [bt-type panu|dun-gsm|dun-cdma]\n\n" + " [bt-type panu|nap|dun-gsm|dun-cdma]\n\n" " vlan: dev <parent device (connection UUID, ifname, or MAC)>\n" " id <VLAN ID>\n" " [flags <VLAN flags>]\n" @@ -3769,7 +3769,7 @@ gen_func_bool_values_l10n (const char *text, int state) static char * gen_func_bt_type (const char *text, int state) { - const char *words[] = { "panu", "dun-gsm", "dun-cdma", NULL }; + const char *words[] = { "panu", "nap", "dun-gsm", "dun-cdma", NULL }; return nmc_rl_gen_func_basic (text, state, words); } @@ -3991,13 +3991,14 @@ set_bluetooth_type (NmCli *nmc, NMConnection *con, const OptionInfo *option, con value = NM_SETTING_BLUETOOTH_TYPE_DUN; setting = nm_setting_cdma_new (); nm_connection_add_setting (con, setting); - } else if (!strcmp (value, NM_SETTING_BLUETOOTH_TYPE_PANU)) { + } else if (!strcmp (value, NM_SETTING_BLUETOOTH_TYPE_PANU) || !strcmp (value, NM_SETTING_BLUETOOTH_TYPE_NAP)) { /* no op */ } else { g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, - _("Error: 'bt-type': '%s' not valid; use [%s, %s (%s), %s]."), - value, NM_SETTING_BLUETOOTH_TYPE_PANU, NM_SETTING_BLUETOOTH_TYPE_DUN, - NM_SETTING_BLUETOOTH_TYPE_DUN"-gsm", NM_SETTING_BLUETOOTH_TYPE_DUN"-cdma"); + _("Error: 'bt-type': '%s' not valid; use [%s, %s, %s (%s), %s]."), + value, NM_SETTING_BLUETOOTH_TYPE_PANU, NM_SETTING_BLUETOOTH_TYPE_NAP, + NM_SETTING_BLUETOOTH_TYPE_DUN, NM_SETTING_BLUETOOTH_TYPE_DUN"-gsm", + NM_SETTING_BLUETOOTH_TYPE_DUN"-cdma"); return FALSE; } diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 3862e17fee..39d958c9f5 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -4817,7 +4817,6 @@ static const NMMetaPropertyInfo *const property_infos_BLUETOOTH[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_BLUETOOTH_BDADDR, .is_cli_option = TRUE, .property_alias = "addr", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, .prompt = N_("Bluetooth device address"), .property_type = &_pt_gobject_mac, ), @@ -4829,7 +4828,8 @@ static const NMMetaPropertyInfo *const property_infos_BLUETOOTH[] = { .property_type = &_pt_gobject_string, .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( .values_static = VALUES_STATIC (NM_SETTING_BLUETOOTH_TYPE_DUN, - NM_SETTING_BLUETOOTH_TYPE_PANU), + NM_SETTING_BLUETOOTH_TYPE_PANU, + NM_SETTING_BLUETOOTH_TYPE_NAP), ), ), NULL diff --git a/clients/common/nm-meta-setting-desc.h b/clients/common/nm-meta-setting-desc.h index e21c9f3971..5d6cfbbc8d 100644 --- a/clients/common/nm-meta-setting-desc.h +++ b/clients/common/nm-meta-setting-desc.h @@ -44,9 +44,10 @@ struct _NMDevice; #define NM_META_TEXT_PROMPT_BT_TYPE N_("Bluetooth type") #define NM_META_TEXT_WORD_PANU "panu" +#define NM_META_TEXT_WORD_NAP "nap" #define NM_META_TEXT_WORD_DUN_GSM "dun-gsm" #define NM_META_TEXT_WORD_DUN_CDMA "dun-cdma" -#define NM_META_TEXT_PROMPT_BT_TYPE_CHOICES "(" NM_META_TEXT_WORD_PANU "/" NM_META_TEXT_WORD_DUN_GSM "/" NM_META_TEXT_WORD_DUN_CDMA ") [" NM_META_TEXT_WORD_PANU "]" +#define NM_META_TEXT_PROMPT_BT_TYPE_CHOICES "(" NM_META_TEXT_WORD_PANU "/" NM_META_TEXT_WORD_NAP "/" NM_META_TEXT_WORD_DUN_GSM "/" NM_META_TEXT_WORD_DUN_CDMA ") [" NM_META_TEXT_WORD_PANU "]" #define NM_META_TEXT_PROMPT_BOND_MODE N_("Bonding mode") diff --git a/man/nmcli.xml b/man/nmcli.xml index 8ee7914b15..58a7004f07 100644 --- a/man/nmcli.xml +++ b/man/nmcli.xml @@ -1804,10 +1804,10 @@ property as well. <row> <entry align="left">bt-type</entry> <entry align="left"><link linkend="nm-settings.property.bluetooth.type">bluetooth.type</link></entry> - <entry align="left" valign="top">Apart from the usual <literal>dun</literal> and -<literal>panu</literal> options, the values of <literal>dun-gsm</literal> -and <literal>dun-cdma</literal> can be used for compatibility with older -versions. They are equivalent to using <literal>dun</literal> and setting + <entry align="left" valign="top">Apart from the usual <literal>panu</literal>, +<literal>nap</literal> and <literal>dun</literal> options, the values of +<literal>dun-gsm</literal> and <literal>dun-cdma</literal> can be used for compatibility +with older versions. They are equivalent to using <literal>dun</literal> and setting appropriate <literal>gsm.*</literal> or <literal>cdma.*</literal> properties.</entry> </row> </tbody> |