Hi Rémi,

On 01/07/2011 10:02 AM, Rémi Denis-Courmont wrote:
> ---
>  src/common.c |   14 ++++++++++++++
>  src/common.h |   13 +++++++++++++
>  2 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/src/common.c b/src/common.c
> index d4e567b..6664007 100644
> --- a/src/common.c
> +++ b/src/common.c
> @@ -714,6 +714,20 @@ const char *registration_tech_to_string(int tech)
>       }
>  }
>  
> +const char *packet_bearer_to_string(int bearer)
> +{
> +     static const char list[][6] = {
> +             "none",
> +             "gsm", "edge",
> +             "umts", "hsupa", "hsdpa", "hspa",
> +             "lte",
> +     };
> +
> +     if (((unsigned)bearer) < sizeof (list) / sizeof (list[0]))
> +             return list[bearer];
> +     return "unknown";

doc/coding-style.txt rule M1

Also, please drop the unknown bit and return ""

> +}
> +
>  gboolean is_valid_apn(const char *apn)
>  {
>       int i;
> diff --git a/src/common.h b/src/common.h
> index 64f297e..d11cd8e 100644
> --- a/src/common.h
> +++ b/src/common.h
> @@ -87,6 +87,18 @@ enum bearer_class {
>       BEARER_CLASS_PAD = 128
>  };
>  
> +/* 27.007 Section 7.29 */
> +enum packet_bearer {
> +     PACKET_BEARER_NONE = 0,
> +     PACKET_BEARER_GPRS = 1,
> +     PACKET_BEARER_EDGE = 2,
> +     PACKET_BEARER_UMTS = 3,
> +     PACKET_BEARER_HSUPA = 4,
> +     PACKET_BEARER_HSDPA = 5,
> +     PACKET_BEARER_HSUPA_HSDPA = 6,
> +     PACKET_BEARER_LTE = 7,
> +};
> +

doc/coding-style.txt rule M11

>  /* 22.030 Section 6.5.2 */
>  enum ss_control_type {
>       SS_CONTROL_TYPE_ACTIVATION,
> @@ -158,5 +170,6 @@ gboolean is_valid_pin(const char *pin, enum pin_type 
> type);
>  
>  const char *registration_status_to_string(int status);
>  const char *registration_tech_to_string(int tech);
> +const char *packet_bearer_to_string(int bearer);
>  
>  gboolean is_valid_apn(const char *apn);

Regards,
-Denis
_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to