Open Source Telephony
 help / color / mirror / Atom feed
* [PATCHv2 1/4] sim: header definitions for AID session APIs
@ 2017-11-03 22:34 James Prestwood
  2017-11-03 22:34 ` [PATCHv2 2/4] sim: AID session management James Prestwood
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: James Prestwood @ 2017-11-03 22:34 UTC (permalink / raw)
  To: ofono

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

ISIM and newer AID's require opening a logical channel to read
their EF's. This requires new driver API's to discover AID's,
open/close a channel, and reading the EF's from an opened channel.

This functionality was moved from the simauth module.
---
 include/sim.h | 30 ++++++++++++++++++++++++++++++
 src/ofono.h   | 27 +++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/include/sim.h b/include/sim.h
index 0c91ce2..4c0d4b1 100644
--- a/include/sim.h
+++ b/include/sim.h
@@ -121,6 +121,18 @@ typedef void (*ofono_sim_lock_unlock_cb_t)(const struct ofono_error *error,
 typedef void (*ofono_query_facility_lock_cb_t)(const struct ofono_error *error,
 					ofono_bool_t status, void *data);
 
+typedef void (*ofono_sim_list_apps_cb_t)(const struct ofono_error *error,
+					const unsigned char *dataobj,
+					int len, void *data);
+typedef void (*ofono_sim_open_channel_cb_t)(const struct ofono_error *error,
+					int session_id, void *data);
+
+typedef void (*ofono_sim_close_channel_cb_t)(const struct ofono_error *error,
+					void *data);
+
+typedef void (*ofono_sim_session_event_cb_t)(ofono_bool_t active,
+		int session_id, void *data);
+
 struct ofono_sim_driver {
 	const char *name;
 	int (*probe)(struct ofono_sim *sim, unsigned int vendor, void *data);
@@ -173,6 +185,24 @@ struct ofono_sim_driver {
 	void (*query_facility_lock)(struct ofono_sim *sim,
 			enum ofono_sim_password_type lock,
 			ofono_query_facility_lock_cb_t cb, void *data);
+	void (*list_apps)(struct ofono_sim *sim,
+			ofono_sim_list_apps_cb_t cb, void *data);
+	void (*open_channel)(struct ofono_sim *sim, const unsigned char *aid,
+			ofono_sim_open_channel_cb_t cb, void *data);
+	void (*close_channel)(struct ofono_sim *sim, int session_id,
+			ofono_sim_close_channel_cb_t cb, void *data);
+	void (*session_read_binary)(struct ofono_sim *sim, int session,
+			int fileid, int start, int length,
+			const unsigned char *path, unsigned int path_len,
+			ofono_sim_read_cb_t cb, void *data);
+	void (*session_read_record)(struct ofono_sim *sim, int session_id,
+			int fileid, int record, int length,
+			const unsigned char *path, unsigned int path_len,
+			ofono_sim_read_cb_t cb, void *data);
+	void (*session_read_info)(struct ofono_sim *sim, int session_id,
+			int fileid, const unsigned char *path,
+			unsigned int path_len, ofono_sim_file_info_cb_t cb,
+			void *data);
 };
 
 int ofono_sim_driver_register(const struct ofono_sim_driver *d);
diff --git a/src/ofono.h b/src/ofono.h
index bac4b48..ddfd045 100644
--- a/src/ofono.h
+++ b/src/ofono.h
@@ -370,6 +370,9 @@ unsigned short __ofono_sms_get_next_ref(struct ofono_sms *sms);
 
 #include <ofono/sim.h>
 
+struct ofono_sim_aid_session;
+enum sim_app_type;
+
 ofono_bool_t __ofono_sim_ust_service_available(struct ofono_sim *sim,
 						int ust_service);
 ofono_bool_t __ofono_sim_service_available(struct ofono_sim *sim,
@@ -389,6 +392,30 @@ void __ofono_sim_refresh(struct ofono_sim *sim, GSList *file_list,
 
 void __ofono_sim_recheck_pin(struct ofono_sim *sim);
 
+GSList *__ofono_sim_get_aid_list(struct ofono_sim *sim);
+
+unsigned int __ofono_sim_add_session_watch(
+		struct ofono_sim_aid_session *session,
+		ofono_sim_session_event_cb_t notify, void *data,
+		ofono_destroy_func destroy);
+
+void __ofono_sim_remove_session_watch(struct ofono_sim_aid_session *session,
+		unsigned int id);
+
+struct ofono_sim_aid_session *__ofono_sim_get_session_by_aid(
+		struct ofono_sim *sim, unsigned char *aid);
+
+struct ofono_sim_aid_session *__ofono_sim_get_session_by_type(
+		struct ofono_sim *sim, enum sim_app_type type);
+
+int __ofono_sim_session_get_id(struct ofono_sim_aid_session *session);
+
+enum sim_app_type __ofono_sim_session_get_type(
+		struct ofono_sim_aid_session *session);
+
+unsigned char *__ofono_sim_session_get_aid(
+		struct ofono_sim_aid_session *session);
+
 #include <ofono/stk.h>
 
 typedef void (*__ofono_sms_sim_download_cb_t)(ofono_bool_t ok,
-- 
2.7.4


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

end of thread, other threads:[~2017-11-03 23:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-03 22:34 [PATCHv2 1/4] sim: header definitions for AID session APIs James Prestwood
2017-11-03 22:34 ` [PATCHv2 2/4] sim: AID session management James Prestwood
2017-11-03 22:34 ` [PATCHv2 3/4] atmodem: helper for appending the file path to a command James Prestwood
2017-11-03 22:34 ` [PATCHv2 4/4] atmodem: implement new driver APIs for AID sessions James Prestwood
2017-11-03 23:04 ` [PATCHv2 1/4] sim: header definitions for AID session APIs Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox