Hi Remi,
> src/common.c | 15 +++++++++++++++
> src/common.h | 13 +++++++++++++
> 2 files changed, 28 insertions(+), 0 deletions(-)
>
> diff --git a/src/common.c b/src/common.c
> index d4e567b..595bc53 100644
> --- a/src/common.c
> +++ b/src/common.c
> @@ -714,6 +714,21 @@ 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";
> +}
since every other piece inside oFono uses a switch statement for this,
please do the same. And since packet bearer is an enum, please use that
enum as well. If we ever add an additional value, then the compiler will
tell us to adapt this code.
Regards
Marcel
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono