[PATCH 2/8] ublox: update frequency bands support

Aleksander Morgado aleksander at aleksander.es
Thu Sep 7 11:01:47 UTC 2017


On 22/08/17 08:18, Aleksander Morgado wrote:
> Updated to use the non-deprecated MMModemBand values.

Pushed to git master.

> ---
>  plugins/ublox/mm-modem-helpers-ublox.c         | 17 ++---
>  plugins/ublox/tests/test-modem-helpers-ublox.c | 88 +++++++++++++-------------
>  2 files changed, 54 insertions(+), 51 deletions(-)
> 
> diff --git a/plugins/ublox/mm-modem-helpers-ublox.c b/plugins/ublox/mm-modem-helpers-ublox.c
> index bee1a8f0..9df85dc3 100644
> --- a/plugins/ublox/mm-modem-helpers-ublox.c
> +++ b/plugins/ublox/mm-modem-helpers-ublox.c
> @@ -556,50 +556,51 @@ static const BandConfiguration band_configuration[] = {
>      },
>      {
>          .ubandsel_value = 800,
> -        .bands_3g = { MM_MODEM_BAND_U800 },
> +        .bands_3g = { MM_MODEM_BAND_UTRAN_6 },
>          .bands_4g = { MM_MODEM_BAND_EUTRAN_20 }
>      },
>      {
>          .ubandsel_value = 850,
>          .bands_2g = { MM_MODEM_BAND_G850 },
> -        .bands_3g = { MM_MODEM_BAND_U850 },
> +        .bands_3g = { MM_MODEM_BAND_UTRAN_5 },
>          .bands_4g = { MM_MODEM_BAND_EUTRAN_5 }
>      },
>      {
>          .ubandsel_value = 900,
>          .bands_2g = { MM_MODEM_BAND_EGSM },
> -        .bands_3g = { MM_MODEM_BAND_U900 },
> +        .bands_3g = { MM_MODEM_BAND_UTRAN_8 },
>          .bands_4g = { MM_MODEM_BAND_EUTRAN_8 }
>      },
>      {
>          .ubandsel_value = 1500,
> +        .bands_3g = { MM_MODEM_BAND_UTRAN_11 },
>          .bands_4g = { MM_MODEM_BAND_EUTRAN_11 }
>      },
>      {
>          .ubandsel_value = 1700,
> -        .bands_3g = { MM_MODEM_BAND_U17IV },
> +        .bands_3g = { MM_MODEM_BAND_UTRAN_4 },
>          .bands_4g = { MM_MODEM_BAND_EUTRAN_4 }
>      },
>      {
>          .ubandsel_value = 1800,
>          .bands_2g = { MM_MODEM_BAND_DCS },
> -        .bands_3g = { MM_MODEM_BAND_U1800 },
> +        .bands_3g = { MM_MODEM_BAND_UTRAN_3 },
>          .bands_4g = { MM_MODEM_BAND_EUTRAN_3 }
>      },
>      {
>          .ubandsel_value = 1900,
>          .bands_2g = { MM_MODEM_BAND_PCS },
> -        .bands_3g = { MM_MODEM_BAND_U1900 },
> +        .bands_3g = { MM_MODEM_BAND_UTRAN_2 },
>          .bands_4g = { MM_MODEM_BAND_EUTRAN_2 }
>      },
>      {
>          .ubandsel_value = 2100,
> -        .bands_3g = { MM_MODEM_BAND_U2100 },
> +        .bands_3g = { MM_MODEM_BAND_UTRAN_1 },
>          .bands_4g = { MM_MODEM_BAND_EUTRAN_1 }
>      },
>      {
>          .ubandsel_value = 2600,
> -        .bands_3g = { MM_MODEM_BAND_U2600 },
> +        .bands_3g = { MM_MODEM_BAND_UTRAN_7 },
>          .bands_4g = { MM_MODEM_BAND_EUTRAN_7 }
>      },
>  };
> diff --git a/plugins/ublox/tests/test-modem-helpers-ublox.c b/plugins/ublox/tests/test-modem-helpers-ublox.c
> index c85eaeea..a4fee0c6 100644
> --- a/plugins/ublox/tests/test-modem-helpers-ublox.c
> +++ b/plugins/ublox/tests/test-modem-helpers-ublox.c
> @@ -522,15 +522,15 @@ test_supported_bands_all (void)
>      /* All 2G, 3G and 4G bands */
>      const MMModemBand expected_bands[] = {
>          /*  700 */ MM_MODEM_BAND_EUTRAN_13, MM_MODEM_BAND_EUTRAN_17,
> -        /*  800 */ MM_MODEM_BAND_U800, MM_MODEM_BAND_EUTRAN_20,
> -        /*  850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_U850, MM_MODEM_BAND_EUTRAN_5,
> -        /*  900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_U900, MM_MODEM_BAND_EUTRAN_8,
> -        /* 1500 */ MM_MODEM_BAND_EUTRAN_11,
> -        /* 1700 */ MM_MODEM_BAND_U17IV, MM_MODEM_BAND_EUTRAN_4,
> -        /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_U1800, MM_MODEM_BAND_EUTRAN_3,
> -        /* 1900 */ MM_MODEM_BAND_PCS, MM_MODEM_BAND_U1900, MM_MODEM_BAND_EUTRAN_2,
> -        /* 2100 */ MM_MODEM_BAND_U2100, MM_MODEM_BAND_EUTRAN_1,
> -        /* 2600 */ MM_MODEM_BAND_U2600, MM_MODEM_BAND_EUTRAN_7,
> +        /*  800 */ MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_EUTRAN_20,
> +        /*  850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_EUTRAN_5,
> +        /*  900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_EUTRAN_8,
> +        /* 1500 */ MM_MODEM_BAND_UTRAN_11, MM_MODEM_BAND_EUTRAN_11,
> +        /* 1700 */ MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_EUTRAN_4,
> +        /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_EUTRAN_3,
> +        /* 1900 */ MM_MODEM_BAND_PCS, MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_EUTRAN_2,
> +        /* 2100 */ MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_EUTRAN_1,
> +        /* 2600 */ MM_MODEM_BAND_UTRAN_7, MM_MODEM_BAND_EUTRAN_7,
>      };
>  
>      common_validate_supported_bands (NULL, expected_bands, G_N_ELEMENTS (expected_bands));
> @@ -542,15 +542,15 @@ test_supported_bands_toby_l201 (void)
>      /* Only 3G and 4G bands */
>      const MMModemBand expected_bands[] = {
>          /*  700 */ MM_MODEM_BAND_EUTRAN_13, MM_MODEM_BAND_EUTRAN_17,
> -        /*  800 */ MM_MODEM_BAND_U800, MM_MODEM_BAND_EUTRAN_20,
> -        /*  850 */ MM_MODEM_BAND_U850, MM_MODEM_BAND_EUTRAN_5,
> -        /*  900 */ MM_MODEM_BAND_U900, MM_MODEM_BAND_EUTRAN_8,
> -        /* 1500 */ MM_MODEM_BAND_EUTRAN_11,
> -        /* 1700 */ MM_MODEM_BAND_U17IV, MM_MODEM_BAND_EUTRAN_4,
> -        /* 1800 */ MM_MODEM_BAND_U1800, MM_MODEM_BAND_EUTRAN_3,
> -        /* 1900 */ MM_MODEM_BAND_U1900, MM_MODEM_BAND_EUTRAN_2,
> -        /* 2100 */ MM_MODEM_BAND_U2100, MM_MODEM_BAND_EUTRAN_1,
> -        /* 2600 */ MM_MODEM_BAND_U2600, MM_MODEM_BAND_EUTRAN_7,
> +        /*  800 */ MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_EUTRAN_20,
> +        /*  850 */ MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_EUTRAN_5,
> +        /*  900 */ MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_EUTRAN_8,
> +        /* 1500 */ MM_MODEM_BAND_UTRAN_11, MM_MODEM_BAND_EUTRAN_11,
> +        /* 1700 */ MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_EUTRAN_4,
> +        /* 1800 */ MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_EUTRAN_3,
> +        /* 1900 */ MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_EUTRAN_2,
> +        /* 2100 */ MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_EUTRAN_1,
> +        /* 2600 */ MM_MODEM_BAND_UTRAN_7, MM_MODEM_BAND_EUTRAN_7,
>      };
>  
>      common_validate_supported_bands ("TOBY-L201", expected_bands, G_N_ELEMENTS (expected_bands));
> @@ -561,14 +561,15 @@ test_supported_bands_lisa_u200 (void)
>  {
>      /* Only 2G and 3G bands */
>      const MMModemBand expected_bands[] = {
> -        /*  800 */ MM_MODEM_BAND_U800,
> -        /*  850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_U850,
> -        /*  900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_U900,
> -        /* 1700 */ MM_MODEM_BAND_U17IV,
> -        /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_U1800,
> -        /* 1900 */ MM_MODEM_BAND_PCS, MM_MODEM_BAND_U1900,
> -        /* 2100 */ MM_MODEM_BAND_U2100,
> -        /* 2600 */ MM_MODEM_BAND_U2600,
> +        /*  800 */ MM_MODEM_BAND_UTRAN_6,
> +        /*  850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5,
> +        /*  900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_UTRAN_8,
> +        /* 1500 */ MM_MODEM_BAND_UTRAN_11,
> +        /* 1700 */ MM_MODEM_BAND_UTRAN_4,
> +        /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_UTRAN_3,
> +        /* 1900 */ MM_MODEM_BAND_PCS, MM_MODEM_BAND_UTRAN_2,
> +        /* 2100 */ MM_MODEM_BAND_UTRAN_1,
> +        /* 2600 */ MM_MODEM_BAND_UTRAN_7,
>      };
>  
>      common_validate_supported_bands ("LISA-U200", expected_bands, G_N_ELEMENTS (expected_bands));
> @@ -579,14 +580,15 @@ test_supported_bands_sara_u280 (void)
>  {
>      /* Only 3G bands */
>      const MMModemBand expected_bands[] = {
> -        /*  800 */ MM_MODEM_BAND_U800,
> -        /*  850 */ MM_MODEM_BAND_U850,
> -        /*  900 */ MM_MODEM_BAND_U900,
> -        /* 1700 */ MM_MODEM_BAND_U17IV,
> -        /* 1800 */ MM_MODEM_BAND_U1800,
> -        /* 1900 */ MM_MODEM_BAND_U1900,
> -        /* 2100 */ MM_MODEM_BAND_U2100,
> -        /* 2600 */ MM_MODEM_BAND_U2600,
> +        /*  800 */ MM_MODEM_BAND_UTRAN_6,
> +        /*  850 */ MM_MODEM_BAND_UTRAN_5,
> +        /*  900 */ MM_MODEM_BAND_UTRAN_8,
> +        /* 1500 */ MM_MODEM_BAND_UTRAN_11,
> +        /* 1700 */ MM_MODEM_BAND_UTRAN_4,
> +        /* 1800 */ MM_MODEM_BAND_UTRAN_3,
> +        /* 1900 */ MM_MODEM_BAND_UTRAN_2,
> +        /* 2100 */ MM_MODEM_BAND_UTRAN_1,
> +        /* 2600 */ MM_MODEM_BAND_UTRAN_7,
>      };
>  
>      common_validate_supported_bands ("SARA-U280", expected_bands, G_N_ELEMENTS (expected_bands));
> @@ -630,8 +632,8 @@ test_ubandsel_response_four (void)
>      const MMModemBand expected_bands[] = {
>          /*  850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_U850, MM_MODEM_BAND_EUTRAN_5,
>          /*  900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_U900, MM_MODEM_BAND_EUTRAN_8,
> -        /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_U1800, MM_MODEM_BAND_EUTRAN_3,
> -        /* 1900 */ MM_MODEM_BAND_PCS, MM_MODEM_BAND_U1900, MM_MODEM_BAND_EUTRAN_2,
> +        /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_EUTRAN_3,
> +        /* 1900 */ MM_MODEM_BAND_PCS, MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_EUTRAN_2,
>      };
>  
>      common_validate_ubandsel_response ("+UBANDSEL: 850,900,1800,1900\r\n", expected_bands, G_N_ELEMENTS (expected_bands));
> @@ -641,9 +643,9 @@ static void
>  test_ubandsel_response_three (void)
>  {
>      const MMModemBand expected_bands[] = {
> -        /*  850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_U850, MM_MODEM_BAND_EUTRAN_5,
> -        /*  900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_U900, MM_MODEM_BAND_EUTRAN_8,
> -        /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_U1800, MM_MODEM_BAND_EUTRAN_3,
> +        /*  850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_EUTRAN_5,
> +        /*  900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_EUTRAN_8,
> +        /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_EUTRAN_3,
>      };
>  
>      common_validate_ubandsel_response ("+UBANDSEL: 850,900,1800\r\n", expected_bands, G_N_ELEMENTS (expected_bands));
> @@ -653,8 +655,8 @@ static void
>  test_ubandsel_response_two (void)
>  {
>      const MMModemBand expected_bands[] = {
> -        /*  850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_U850, MM_MODEM_BAND_EUTRAN_5,
> -        /*  900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_U900, MM_MODEM_BAND_EUTRAN_8,
> +        /*  850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_EUTRAN_5,
> +        /*  900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_EUTRAN_8,
>      };
>  
>      common_validate_ubandsel_response ("+UBANDSEL: 850,900\r\n", expected_bands, G_N_ELEMENTS (expected_bands));
> @@ -664,7 +666,7 @@ static void
>  test_ubandsel_response_one (void)
>  {
>      const MMModemBand expected_bands[] = {
> -        /*  850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_U850, MM_MODEM_BAND_EUTRAN_5,
> +        /*  850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_EUTRAN_5,
>      };
>  
>      common_validate_ubandsel_response ("+UBANDSEL: 850\r\n", expected_bands, G_N_ELEMENTS (expected_bands));
> @@ -719,7 +721,7 @@ static void
>  test_ubandsel_request_1800 (void)
>  {
>      const MMModemBand bands[] = {
> -        MM_MODEM_BAND_DCS, MM_MODEM_BAND_U1800, MM_MODEM_BAND_EUTRAN_3
> +        MM_MODEM_BAND_DCS, MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_EUTRAN_3
>      };
>  
>      common_validate_ubandsel_request (bands, G_N_ELEMENTS (bands), "+UBANDSEL=1800");
> 


-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list