55 lines
1.7 KiB
Diff
55 lines
1.7 KiB
Diff
|
From 99767e9da1b956afdd08c359785721a293931295 Mon Sep 17 00:00:00 2001
|
||
|
From: Alexander Couzens <lynxis@fe80.eu>
|
||
|
Date: Tue, 25 Jul 2017 11:34:36 +0200
|
||
|
Subject: [PATCH 03/17] voicecall,common: promote call_status_to_string()
|
||
|
public
|
||
|
|
||
|
call_status_to_string() is useful for debug output.
|
||
|
Change signature to contain enum call_status
|
||
|
Replace default case to get compiler warning when new enums added
|
||
|
---
|
||
|
src/common.c | 21 +++++++++++++++++++++
|
||
|
src/common.h | 1 +
|
||
|
src/voicecall.c | 24 ++----------------------
|
||
|
3 files changed, 24 insertions(+), 22 deletions(-)
|
||
|
|
||
|
Index: ofono-1.21/src/common.c
|
||
|
===================================================================
|
||
|
--- ofono-1.21.orig/src/common.c
|
||
|
+++ ofono-1.21/src/common.c
|
||
|
@@ -779,3 +779,24 @@ gint ofono_call_compare(gconstpointer a,
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
+
|
||
|
+const char *ofono_call_status_to_string(enum call_status status)
|
||
|
+{
|
||
|
+ switch (status) {
|
||
|
+ case CALL_STATUS_ACTIVE:
|
||
|
+ return "active";
|
||
|
+ case CALL_STATUS_HELD:
|
||
|
+ return "held";
|
||
|
+ case CALL_STATUS_DIALING:
|
||
|
+ return "dialing";
|
||
|
+ case CALL_STATUS_ALERTING:
|
||
|
+ return "alerting";
|
||
|
+ case CALL_STATUS_INCOMING:
|
||
|
+ return "incoming";
|
||
|
+ case CALL_STATUS_WAITING:
|
||
|
+ return "waiting";
|
||
|
+ case CALL_STATUS_DISCONNECTED:
|
||
|
+ return "disconnected";
|
||
|
+ }
|
||
|
+ return "unknown";
|
||
|
+}
|
||
|
Index: ofono-1.21/src/common.h
|
||
|
===================================================================
|
||
|
--- ofono-1.21.orig/src/common.h
|
||
|
+++ ofono-1.21/src/common.h
|
||
|
@@ -185,4 +185,4 @@ const char *packet_bearer_to_string(int
|
||
|
|
||
|
gboolean is_valid_apn(const char *apn);
|
||
|
gint ofono_call_compare(gconstpointer a, gconstpointer b);
|
||
|
-const char *call_status_to_string(enum call_status status);
|
||
|
+const char *ofono_call_status_to_string(enum call_status status);
|