libnm-util: define NM_SETTING_GSM_BANDS_MAX - maximal value for allowed bands

and use it in 'allowed-bands' property installation.

The macro NM_SETTING_GSM_BANDS_MAX also allows libnm-util users to check
if bands are valid (before setting them).
This commit is contained in:
Jiří Klimeš 2013-05-02 18:06:55 +02:00
parent dd80e247a9
commit 5a50e60ac3
2 changed files with 25 additions and 15 deletions

View file

@ -696,21 +696,7 @@ nm_setting_gsm_class_init (NMSettingGsmClass *setting_class)
"Bitfield of allowed frequency bands. Note that "
"not all devices allow frequency band control.",
NM_SETTING_GSM_BAND_UNKNOWN,
NM_SETTING_GSM_BAND_UNKNOWN
| NM_SETTING_GSM_BAND_ANY
| NM_SETTING_GSM_BAND_EGSM
| NM_SETTING_GSM_BAND_DCS
| NM_SETTING_GSM_BAND_PCS
| NM_SETTING_GSM_BAND_G850
| NM_SETTING_GSM_BAND_U2100
| NM_SETTING_GSM_BAND_U1800
| NM_SETTING_GSM_BAND_U17IV
| NM_SETTING_GSM_BAND_U800
| NM_SETTING_GSM_BAND_U850
| NM_SETTING_GSM_BAND_U900
| NM_SETTING_GSM_BAND_U17IX
| NM_SETTING_GSM_BAND_U1900
| NM_SETTING_GSM_BAND_U2600,
NM_SETTING_GSM_BANDS_MAX,
NM_SETTING_GSM_BAND_ANY,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

View file

@ -138,6 +138,30 @@ typedef enum {
NM_SETTING_GSM_BAND_U2600 = 0x00002000, /* WCDMA 3GPP UMTS 2600 MHz (Class VII, internal) */
} NMSettingGsmNetworkBand;
/**
* NM_SETTING_GSM_BANDS_MAX:
*
* #NM_SETTING_GSM_BANDS_MAX macro indicate the maximal value that can be used
* as the allowed frequency bands (#NMSettingGsm:allowed-bands property).
*
* Since: 0.9.10
*/
#define NM_SETTING_GSM_BANDS_MAX ( NM_SETTING_GSM_BAND_UNKNOWN \
| NM_SETTING_GSM_BAND_ANY \
| NM_SETTING_GSM_BAND_EGSM \
| NM_SETTING_GSM_BAND_DCS \
| NM_SETTING_GSM_BAND_PCS \
| NM_SETTING_GSM_BAND_G850 \
| NM_SETTING_GSM_BAND_U2100 \
| NM_SETTING_GSM_BAND_U1800 \
| NM_SETTING_GSM_BAND_U17IV \
| NM_SETTING_GSM_BAND_U800 \
| NM_SETTING_GSM_BAND_U850 \
| NM_SETTING_GSM_BAND_U900 \
| NM_SETTING_GSM_BAND_U17IX \
| NM_SETTING_GSM_BAND_U1900 \
| NM_SETTING_GSM_BAND_U2600)
typedef struct {
NMSetting parent;
} NMSettingGsm;