Skip to contentSkip to conversation

sim: Added set function for CardSlotCount and ActiveCardSlot

PATCH In review Antara Borwankar 2 participants 2 messages Mar 27, 2019 – Mar 28, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 3/6 sim: Added set function for CardSlotCount and ActiveCardSlot

Adding set function definition for CardSlotCount and ActiveCardSlot properties.

---
 include/sim.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/sim.h +8 -0
index fad4c0d..be5d82f 100644
@@ -132,6 +132,9 @@ typedef void (*ofono_sim_close_channel_cb_t)(const struct ofono_error *error,
 typedef void (*ofono_sim_logical_access_cb_t)(const struct ofono_error *error,
 		const unsigned char *resp, unsigned int len, void *data);
 
+typedef void (*ofono_sim_active_slot_change_cb_t)(const struct ofono_error *error,
+					void *data);
+
 struct ofono_sim_driver {
 	const char *name;
 	int (*probe)(struct ofono_sim *sim, unsigned int vendor, void *data);
@@ -205,6 +208,8 @@ struct ofono_sim_driver {
 	void (*logical_access)(struct ofono_sim *sim, int session_id,
 			const unsigned char *pdu, unsigned int len,
 			ofono_sim_logical_access_cb_t cb, void *data);
+	void (*set_active_sim)(struct ofono_sim *sim, unsigned int index,
+			ofono_sim_active_slot_change_cb_t cb, void *data);
 };
 
 int ofono_sim_driver_register(const struct ofono_sim_driver *d);
@@ -219,6 +224,9 @@ void ofono_sim_remove(struct ofono_sim *sim);
 
 void ofono_sim_set_data(struct ofono_sim *sim, void *data);
 void *ofono_sim_get_data(struct ofono_sim *sim);
+void ofono_sim_set_card_slot_num(struct ofono_sim *sim, unsigned int val);
+void ofono_sim_set_active_card_slot_num(struct ofono_sim *sim,
+					unsigned int val);
 
 const char *ofono_sim_get_imsi(struct ofono_sim *sim);
 const char *ofono_sim_get_mcc(struct ofono_sim *sim);
Signature · 1 line
1.9.1
#1 lore raw

Hi Antara,

Quoted 11 lines · Antara Borwankar

Adding set function definition for CardSlotCount and ActiveCardSlot properties.

---
  include/sim.h | 8 ++++++++
  1 file changed, 8 insertions(+)
include/sim.h +0 -0
index fad4c0d..be5d82f 100644

include/sim.h typedef void (*ofono_sim_close_channel_cb_t)(const struct ofono_error *error, · line 137

Quoted 6 lines
include/sim.h +3 -0
@@ -132,6 +132,9 @@ typedef void (*ofono_sim_close_channel_cb_t)(const struct ofono_error *error,
  typedef void (*ofono_sim_logical_access_cb_t)(const struct ofono_error *error,
  		const unsigned char *resp, unsigned int len, void *data);
 
+typedef void (*ofono_sim_active_slot_change_cb_t)(const struct ofono_error *error,
+					void *data);
+

ofono_sim_set_active_card_slot_cb_t

include/sim.h struct ofono_sim_driver { · line 211

Quoted 8 lines
include/sim.h +1 -0
  struct ofono_sim_driver {
  	const char *name;
  	int (*probe)(struct ofono_sim *sim, unsigned int vendor, void *data);
@@ -205,6 +208,8 @@ struct ofono_sim_driver {
  	void (*logical_access)(struct ofono_sim *sim, int session_id,
  			const unsigned char *pdu, unsigned int len,
  			ofono_sim_logical_access_cb_t cb, void *data);
+	void (*set_active_sim)(struct ofono_sim *sim, unsigned int index,

Lets call this set_active_card_slot to be consistent with the D-Bus API

include/sim.h void ofono_sim_remove(struct ofono_sim *sim); · line 227

Quoted 9 lines
include/sim.h +2 -0
+			ofono_sim_active_slot_change_cb_t cb, void *data);
  };
 
  int ofono_sim_driver_register(const struct ofono_sim_driver *d);
@@ -219,6 +224,9 @@ void ofono_sim_remove(struct ofono_sim *sim);
 
  void ofono_sim_set_data(struct ofono_sim *sim, void *data);
  void *ofono_sim_get_data(struct ofono_sim *sim);
+void ofono_sim_set_card_slot_num(struct ofono_sim *sim, unsigned int val);

ofono_sim_set_card_slot_count

include/sim.h void ofono_sim_remove(struct ofono_sim *sim); · line 229

Quoted 2 lines
include/sim.h +2 -0
+void ofono_sim_set_active_card_slot_num(struct ofono_sim *sim,
+					unsigned int val);

ofono_sim_set_active_card_slot

include/sim.h void ofono_sim_remove(struct ofono_sim *sim);

Quoted 4 lines
include/sim.h +0 -0
  const char *ofono_sim_get_imsi(struct ofono_sim *sim);
  const char *ofono_sim_get_mcc(struct ofono_sim *sim);
 

Regards,
-Denis