Commit aedeb3cb authored by Lubomir Rintel's avatar Lubomir Rintel 🥕

clients: add support for Bluetooth NAP type

parent ab46c9c7
......@@ -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;
}
......
......@@ -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
......
......@@ -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")
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment