All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/20] stkutil: Add Set Up Call response builder
@ 2010-05-27  4:59 Andrzej Zaborowski
  2010-05-27  4:59 ` [PATCH 02/20] test-stkutil: Add Set Up Call response tests Andrzej Zaborowski
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: Andrzej Zaborowski @ 2010-05-27  4:59 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2971 bytes --]

---
 src/stkutil.c |   37 +++++++++++++++++++++++++++++++++++++
 src/stkutil.h |    9 +++++++++
 2 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 2ca5c6a..c9b9511 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -3383,6 +3383,20 @@ static gboolean build_dataobj_text(struct stk_tlv_builder *tlv,
 	return stk_tlv_builder_close_container(tlv);
 }
 
+/* Described in TS 102.223 Section 8.30 */
+static gboolean build_dataobj_cc_requested_action(struct stk_tlv_builder *tlv,
+						const void *data, gboolean cr)
+{
+	const struct stk_common_byte_array *action = data;
+	unsigned char tag = STK_DATA_OBJECT_TYPE_CALL_CONTROL_REQUESTED_ACTION;
+
+	return action->array == NULL ||
+		(stk_tlv_builder_open_container(tlv, cr, tag, FALSE) &&
+		 stk_tlv_builder_append_bytes(tlv,
+						action->array, action->len) &&
+		 stk_tlv_builder_close_container(tlv));
+}
+
 static gboolean build_dataobj(struct stk_tlv_builder *tlv,
 				dataobj_writer builder_func, ...)
 {
@@ -3404,6 +3418,26 @@ static gboolean build_dataobj(struct stk_tlv_builder *tlv,
 	return TRUE;
 }
 
+static gboolean build_set_up_call(struct stk_tlv_builder *builder,
+					const struct stk_response *response)
+{
+	if (response->set_up_call.modified_result.cc_modified)
+		return build_dataobj(builder,
+				build_dataobj_cc_requested_action,
+				DATAOBJ_FLAG_CR,
+				&response->set_up_call.cc_requested_action,
+				build_dataobj_result,
+				DATAOBJ_FLAG_CR,
+				&response->set_up_call.modified_result.result,
+				NULL);
+	else
+		return build_dataobj(builder,
+				build_dataobj_cc_requested_action,
+				DATAOBJ_FLAG_CR,
+				&response->set_up_call.cc_requested_action,
+				NULL);
+}
+
 unsigned int stk_pdu_from_response(const struct stk_response *response,
 					unsigned char *pdu, unsigned int size)
 {
@@ -3495,6 +3529,9 @@ unsigned int stk_pdu_from_response(const struct stk_response *response,
 					&response->select_item.item_id,
 					NULL);
 		break;
+	case STK_COMMAND_TYPE_SETUP_CALL:
+		ok = build_set_up_call(&builder, response);
+		break;
 	default:
 		return 0;
 	};
diff --git a/src/stkutil.h b/src/stkutil.h
index b04078f..3245a90 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -1069,6 +1069,14 @@ struct stk_response_select_item {
 	unsigned char item_id;
 };
 
+struct stk_response_set_up_call {
+	struct stk_common_byte_array cc_requested_action;
+	struct {
+		ofono_bool_t cc_modified;
+		struct stk_result result;
+	} modified_result;
+};
+
 struct stk_response {
 	unsigned char number;
 	unsigned char type;
@@ -1087,6 +1095,7 @@ struct stk_response {
 		struct stk_response_generic set_up_menu;
 		struct stk_response_select_item select_item;
 		struct stk_response_generic send_sms;
+		struct stk_response_set_up_call set_up_call;
 	};
 
 	void (*destructor)(struct stk_response *response);
-- 
1.7.1.86.g0e460.dirty


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2010-05-28 16:42 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-27  4:59 [PATCH 01/20] stkutil: Add Set Up Call response builder Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 02/20] test-stkutil: Add Set Up Call response tests Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 03/20] stkutil: Add Polling Off response builder support Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 04/20] test-stkutil: Add a Polling Off response test Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 05/20] stkutil: Add the Provide Local Info response builder Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 06/20] test-stkutil: Add Provide Local Info response tests Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 07/20] stkutil: Add Set Up Event List response builder support Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 08/20] test-stkutil: Add a Set Up Event List response test Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 09/20] stkutil: Add the Timer Management response builder Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 10/20] test-stkutil: Add Timer Management response tests Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 11/20] stkutil: Add Set Up Idle Mode Text response builder support Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 12/20] test-stkutil: Add Set Up Idle Mode response builder tests Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 13/20] stkutil: Add the Run AT Command response builder Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 14/20] test-stkutil: Add Run AT Command response builder tests Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 15/20] stkutil: Add Send DTMF response builder support Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 16/20] test-stkutil: Add the Send DTMF response tests Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 17/20] stkutil: Add Language Notification response builder support Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 18/20] test-stkutil: Add Language Notification response tests Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 19/20] stkutil: Add Launch Browser response builder support Andrzej Zaborowski
2010-05-27  4:59 ` [PATCH 20/20] test-stkutil: Add Launch Browser response builder tests Andrzej Zaborowski
2010-05-28 16:42 ` [PATCH 01/20] stkutil: Add Set Up Call response builder Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.