le_sim_common.h

Go to the documentation of this file.
1 
2 /*
3  * ====================== WARNING ======================
4  *
5  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
6  * DO NOT MODIFY IN ANY WAY.
7  *
8  * ====================== WARNING ======================
9  */
10 /**
11  * @file le_sim_common.h
12  *
13  * Type definitions for le_sim.
14  *
15  */
16 #ifndef LE_SIM_COMMON_H_INCLUDE_GUARD
17 #define LE_SIM_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 // Interface specific includes
23 #include "le_mdmDefs_common.h"
24 
25 #define IFGEN_LE_SIM_PROTOCOL_ID "85ed54b8268b01f02c64a2846482c0d4"
26 #define IFGEN_LE_SIM_MSG_SIZE 276
27 /** @addtogroup le_sim
28  * @{ **/
29 
30 
31 //--------------------------------------------------------------------------------------------------
32 /**
33  * Minimum PIN length (4 digits)
34  */
35 //--------------------------------------------------------------------------------------------------
36 #define LE_SIM_PIN_MIN_LEN 4
37 
38 //--------------------------------------------------------------------------------------------------
39 /**
40  * Maximum PIN length (8 digits)
41  */
42 //--------------------------------------------------------------------------------------------------
43 #define LE_SIM_PIN_MAX_LEN 8
44 
45 //--------------------------------------------------------------------------------------------------
46 /**
47  * Maximum PIN length (8 digits)
48  * One extra byte is added for the null character.
49  */
50 //--------------------------------------------------------------------------------------------------
51 #define LE_SIM_PIN_MAX_BYTES 9
52 
53 //--------------------------------------------------------------------------------------------------
54 /**
55  * PUK length (8 digits)
56  */
57 //--------------------------------------------------------------------------------------------------
58 #define LE_SIM_PUK_MAX_LEN 8
59 
60 //--------------------------------------------------------------------------------------------------
61 /**
62  * PUK length (8 digits)
63  * One extra byte is added for the null character.
64  */
65 //--------------------------------------------------------------------------------------------------
66 #define LE_SIM_PUK_MAX_BYTES 9
67 
68 //--------------------------------------------------------------------------------------------------
69 /**
70  * ICCID length
71  * According to GSM Phase 1
72  */
73 //--------------------------------------------------------------------------------------------------
74 #define LE_SIM_ICCID_LEN 20
75 
76 //--------------------------------------------------------------------------------------------------
77 /**
78  * ICCID length
79  * One extra byte is added for the null character.
80  */
81 //--------------------------------------------------------------------------------------------------
82 #define LE_SIM_ICCID_BYTES 21
83 
84 //--------------------------------------------------------------------------------------------------
85 /**
86  * IMSI length
87  */
88 //--------------------------------------------------------------------------------------------------
89 #define LE_SIM_IMSI_LEN 15
90 
91 //--------------------------------------------------------------------------------------------------
92 /**
93  * IMSI length
94  * One extra byte is added for the null character.
95  */
96 //--------------------------------------------------------------------------------------------------
97 #define LE_SIM_IMSI_BYTES 16
98 
99 //--------------------------------------------------------------------------------------------------
100 /**
101  * APDU length
102  */
103 //--------------------------------------------------------------------------------------------------
104 #define LE_SIM_APDU_MAX_BYTES 255
105 
106 //--------------------------------------------------------------------------------------------------
107 /**
108  * SIM response length
109  */
110 //--------------------------------------------------------------------------------------------------
111 #define LE_SIM_RESPONSE_MAX_BYTES 256
112 
113 //--------------------------------------------------------------------------------------------------
114 /**
115  * SIM file identifier length
116  */
117 //--------------------------------------------------------------------------------------------------
118 #define LE_SIM_FILE_ID_LEN 4
119 
120 //--------------------------------------------------------------------------------------------------
121 /**
122  * SIM file identifier length
123  * One extra byte is added for the null character.
124  */
125 //--------------------------------------------------------------------------------------------------
126 #define LE_SIM_FILE_ID_BYTES 5
127 
128 //--------------------------------------------------------------------------------------------------
129 /**
130  * SIM data command length
131  *
132  */
133 //--------------------------------------------------------------------------------------------------
134 #define LE_SIM_DATA_MAX_BYTES 100
135 
136 //--------------------------------------------------------------------------------------------------
137 /**
138  * SIM file path length
139  */
140 //--------------------------------------------------------------------------------------------------
141 #define LE_SIM_PATH_MAX_LEN 100
142 
143 //--------------------------------------------------------------------------------------------------
144 /**
145  * SIM file path length
146  * One extra byte is added for the null character.
147  */
148 //--------------------------------------------------------------------------------------------------
149 #define LE_SIM_PATH_MAX_BYTES 101
150 
151 //--------------------------------------------------------------------------------------------------
152 /**
153  * eUICC identifier (EID) length
154  */
155 //--------------------------------------------------------------------------------------------------
156 #define LE_SIM_EID_LEN 32
157 
158 //--------------------------------------------------------------------------------------------------
159 /**
160  * eUICC identifier (EID) length
161  * One extra byte is added for the null character.
162  */
163 //--------------------------------------------------------------------------------------------------
164 #define LE_SIM_EID_BYTES 33
165 
166 //--------------------------------------------------------------------------------------------------
167 /**
168  * Reference type for FPLMN list.
169  */
170 //--------------------------------------------------------------------------------------------------
171 typedef struct le_sim_FPLMNList* le_sim_FPLMNListRef_t;
172 
173 
174 //--------------------------------------------------------------------------------------------------
175 /**
176  * SIM states.
177  *
178  */
179 //--------------------------------------------------------------------------------------------------
180 typedef enum
181 {
183  ///< SIM card is inserted and locked.
185  ///< SIM card is absent.
187  ///< SIM card is inserted and unlocked.
189  ///< SIM card is blocked.
191  ///< SIM card is busy.
193  ///< SIM card is powered down.
195  ///< Unknown SIM state.
196 }
198 
199 
200 //--------------------------------------------------------------------------------------------------
201 /**
202  * SIM identifiers.
203  *
204  */
205 //--------------------------------------------------------------------------------------------------
206 typedef enum
207 {
209  ///< Embedded SIM.
211  ///< SIM inserted in external slot 1.
213  ///< SIM inserted in external slot 2.
215  ///< Remote SIM.
217  ///< le_sim APIs are executed on the currently selected SIM. Use this
218  ///< identifier when automatic SIM selection is enabled.
219  LE_SIM_ID_MAX = 5
220  ///<
221 }
223 
224 
225 //--------------------------------------------------------------------------------------------------
226 /**
227  * Card Manufacturer.
228  *
229  */
230 //--------------------------------------------------------------------------------------------------
231 typedef enum
232 {
234  ///< Oberthur.
236  ///< Gemalto.
238  ///< G&D.
240  ///< Morpho.
242  ///< Valid.
243  LE_SIM_MANUFACTURER_MAX = 5
244  ///<
245 }
247 
248 
249 //--------------------------------------------------------------------------------------------------
250 /**
251  * SIM commands.
252  */
253 //--------------------------------------------------------------------------------------------------
254 typedef enum
255 {
257  ///< Read a file record.
259  ///< Read a transparent elementary file.
261  ///< Update a file record.
263  ///< Update a transparent elementary file.
265  ///< Max value
266 }
268 
269 
270 //--------------------------------------------------------------------------------------------------
271 /**
272  * SIM Toolkit events.
273  */
274 //--------------------------------------------------------------------------------------------------
275 typedef enum
276 {
278  ///< SIM card asks to open a logical channel.
280  ///< SIM card asks for a refresh.
282  ///< Unknown SIM Toolkit event.
283 }
285 
286 
287 //--------------------------------------------------------------------------------------------------
288 /**
289  * SIM Toolkit Refresh modes, defined in ETSI TS 102 223 sections 6.4.7 and 8.6.
290  */
291 //--------------------------------------------------------------------------------------------------
292 typedef enum
293 {
295  ///< Initialization and Full File Change Notification.
297  ///< File Change Notification.
299  ///< Initialization and File Change Notification.
301  ///< Initialization.
303  ///< SIM reset.
305  ///< Application reset.
307  ///< Session reset.
309  ///< Steering of Roaming as defined in 3GPP TS 23.122.
311  ///< Steering of Roaming for I-WLAN
312  ///< as defined in 3GPP TS 24.234.
314  ///< eUICC Profile State Change.
316  ///< Invalid SIM Toolkit Refresh mode.
317 }
319 
320 
321 //--------------------------------------------------------------------------------------------------
322 /**
323  * SIM Toolkit Refresh stages.
324  */
325 //--------------------------------------------------------------------------------------------------
326 typedef enum
327 {
329  ///< Waiting for OK to refresh.
331  ///< Refresh succeeded.
333  ///< Refresh failed.
335  ///< Invalid SIM Toolkit Refresh stage.
336 }
338 
339 
340 //--------------------------------------------------------------------------------------------------
341 /**
342  * Reference type used by Add/Remove functions for EVENT 'le_sim_NewState'
343  */
344 //--------------------------------------------------------------------------------------------------
345 typedef struct le_sim_NewStateHandler* le_sim_NewStateHandlerRef_t;
346 
347 
348 //--------------------------------------------------------------------------------------------------
349 /**
350  * Reference type used by Add/Remove functions for EVENT 'le_sim_ProfileUpdate'
351  */
352 //--------------------------------------------------------------------------------------------------
353 typedef struct le_sim_ProfileUpdateHandler* le_sim_ProfileUpdateHandlerRef_t;
354 
355 
356 //--------------------------------------------------------------------------------------------------
357 /**
358  * Reference type used by Add/Remove functions for EVENT 'le_sim_SimToolkitEvent'
359  */
360 //--------------------------------------------------------------------------------------------------
361 typedef struct le_sim_SimToolkitEventHandler* le_sim_SimToolkitEventHandlerRef_t;
362 
363 
364 //--------------------------------------------------------------------------------------------------
365 /**
366  * Reference type used by Add/Remove functions for EVENT 'le_sim_IccidChange'
367  */
368 //--------------------------------------------------------------------------------------------------
369 typedef struct le_sim_IccidChangeHandler* le_sim_IccidChangeHandlerRef_t;
370 
371 
372 //--------------------------------------------------------------------------------------------------
373 /**
374  * Handler for sim state changes.
375  *
376  */
377 //--------------------------------------------------------------------------------------------------
378 typedef void (*le_sim_NewStateHandlerFunc_t)
379 (
380  le_sim_Id_t simId,
381  ///< The SIM identifier.
382  le_sim_States_t simState,
383  ///< The SIM state.
384  void* contextPtr
385  ///<
386 );
387 
388 //--------------------------------------------------------------------------------------------------
389 /**
390  * Handler for profile update events.
391  *
392  */
393 //--------------------------------------------------------------------------------------------------
394 typedef void (*le_sim_ProfileUpdateHandlerFunc_t)
395 (
396  le_sim_Id_t simId,
397  ///< The SIM identifier.
398  le_sim_StkEvent_t stkEvent,
399  ///< The SIM state.
400  void* contextPtr
401  ///<
402 );
403 
404 //--------------------------------------------------------------------------------------------------
405 /**
406  * Handler for Sim Toolkit Events.
407  *
408  */
409 //--------------------------------------------------------------------------------------------------
411 (
412  le_sim_Id_t simId,
413  ///< The SIM identifier.
414  le_sim_StkEvent_t stkEvent,
415  ///< The SIM state.
416  void* contextPtr
417  ///<
418 );
419 
420 //--------------------------------------------------------------------------------------------------
421 /**
422  * Handler for ICCID change events.
423  *
424  */
425 //--------------------------------------------------------------------------------------------------
426 typedef void (*le_sim_IccidChangeHandlerFunc_t)
427 (
428  le_sim_Id_t simId,
429  ///< The SIM identifier.
430  const char* LE_NONNULL iccid,
431  ///< ICCID
432  void* contextPtr
433  ///<
434 );
435 
436 
437 //--------------------------------------------------------------------------------------------------
438 /**
439  * Get if this client bound locally.
440  */
441 //--------------------------------------------------------------------------------------------------
442 LE_SHARED bool ifgen_le_sim_HasLocalBinding
443 (
444  void
445 );
446 
447 
448 //--------------------------------------------------------------------------------------------------
449 /**
450  * Init data that is common across all threads
451  */
452 //--------------------------------------------------------------------------------------------------
453 LE_SHARED void ifgen_le_sim_InitCommonData
454 (
455  void
456 );
457 
458 
459 //--------------------------------------------------------------------------------------------------
460 /**
461  * Perform common initialization and open a session
462  */
463 //--------------------------------------------------------------------------------------------------
464 LE_SHARED le_result_t ifgen_le_sim_OpenSession
465 (
466  le_msg_SessionRef_t _ifgen_sessionRef,
467  bool isBlocking
468 );
469 
470 //--------------------------------------------------------------------------------------------------
471 /**
472  * Add handler function for EVENT 'le_sim_NewState'
473  *
474  * This event provides information on sim state changes.
475  *
476  */
477 //--------------------------------------------------------------------------------------------------
478 LE_SHARED le_sim_NewStateHandlerRef_t ifgen_le_sim_AddNewStateHandler
479 (
480  le_msg_SessionRef_t _ifgen_sessionRef,
481  le_sim_NewStateHandlerFunc_t handlerPtr,
482  ///< [IN]
483  void* contextPtr
484  ///< [IN]
485 );
486 
487 //--------------------------------------------------------------------------------------------------
488 /**
489  * Remove handler function for EVENT 'le_sim_NewState'
490  */
491 //--------------------------------------------------------------------------------------------------
492 LE_SHARED void ifgen_le_sim_RemoveNewStateHandler
493 (
494  le_msg_SessionRef_t _ifgen_sessionRef,
495  le_sim_NewStateHandlerRef_t handlerRef
496  ///< [IN]
497 );
498 
499 //--------------------------------------------------------------------------------------------------
500 /**
501  * Add handler function for EVENT 'le_sim_ProfileUpdate'
502  *
503  * This event provides information on profile update
504  *
505  */
506 //--------------------------------------------------------------------------------------------------
507 LE_SHARED le_sim_ProfileUpdateHandlerRef_t ifgen_le_sim_AddProfileUpdateHandler
508 (
509  le_msg_SessionRef_t _ifgen_sessionRef,
511  ///< [IN]
512  void* contextPtr
513  ///< [IN]
514 );
515 
516 //--------------------------------------------------------------------------------------------------
517 /**
518  * Remove handler function for EVENT 'le_sim_ProfileUpdate'
519  */
520 //--------------------------------------------------------------------------------------------------
521 LE_SHARED void ifgen_le_sim_RemoveProfileUpdateHandler
522 (
523  le_msg_SessionRef_t _ifgen_sessionRef,
525  ///< [IN]
526 );
527 
528 //--------------------------------------------------------------------------------------------------
529 /**
530  * Add handler function for EVENT 'le_sim_SimToolkitEvent'
531  *
532  * This event provides information on Sim Toolkit application.
533  *
534  */
535 //--------------------------------------------------------------------------------------------------
536 LE_SHARED le_sim_SimToolkitEventHandlerRef_t ifgen_le_sim_AddSimToolkitEventHandler
537 (
538  le_msg_SessionRef_t _ifgen_sessionRef,
540  ///< [IN]
541  void* contextPtr
542  ///< [IN]
543 );
544 
545 //--------------------------------------------------------------------------------------------------
546 /**
547  * Remove handler function for EVENT 'le_sim_SimToolkitEvent'
548  */
549 //--------------------------------------------------------------------------------------------------
550 LE_SHARED void ifgen_le_sim_RemoveSimToolkitEventHandler
551 (
552  le_msg_SessionRef_t _ifgen_sessionRef,
554  ///< [IN]
555 );
556 
557 //--------------------------------------------------------------------------------------------------
558 /**
559  * Add handler function for EVENT 'le_sim_IccidChange'
560  *
561  * This event provides information on ICCID
562  *
563  */
564 //--------------------------------------------------------------------------------------------------
565 LE_SHARED le_sim_IccidChangeHandlerRef_t ifgen_le_sim_AddIccidChangeHandler
566 (
567  le_msg_SessionRef_t _ifgen_sessionRef,
569  ///< [IN]
570  void* contextPtr
571  ///< [IN]
572 );
573 
574 //--------------------------------------------------------------------------------------------------
575 /**
576  * Remove handler function for EVENT 'le_sim_IccidChange'
577  */
578 //--------------------------------------------------------------------------------------------------
579 LE_SHARED void ifgen_le_sim_RemoveIccidChangeHandler
580 (
581  le_msg_SessionRef_t _ifgen_sessionRef,
583  ///< [IN]
584 );
585 
586 //--------------------------------------------------------------------------------------------------
587 /**
588  * Get the current selected card.
589  *
590  * @return Number of the current selected SIM card.
591  */
592 //--------------------------------------------------------------------------------------------------
593 LE_SHARED le_sim_Id_t ifgen_le_sim_GetSelectedCard
594 (
595  le_msg_SessionRef_t _ifgen_sessionRef
596 );
597 
598 //--------------------------------------------------------------------------------------------------
599 /**
600  * Select a SIM.
601  *
602  * @return LE_FAULT Function failed to select the requested SIM
603  * @return LE_OK Function succeeded.
604  *
605  */
606 //--------------------------------------------------------------------------------------------------
607 LE_SHARED le_result_t ifgen_le_sim_SelectCard
608 (
609  le_msg_SessionRef_t _ifgen_sessionRef,
610  le_sim_Id_t simId
611  ///< [IN] The SIM identifier.
612 );
613 
614 //--------------------------------------------------------------------------------------------------
615 /**
616  * Retrieves the integrated circuit card identifier (ICCID) of the SIM card (20 digits)
617  *
618  * @return LE_OK ICCID was successfully retrieved.
619  * @return LE_OVERFLOW iccidPtr buffer was too small for the ICCID.
620  * @return LE_BAD_PARAMETER Invalid parameters.
621  * @return LE_FAULT The ICCID could not be retrieved.
622  *
623  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
624  * function will not return.
625  */
626 //--------------------------------------------------------------------------------------------------
627 LE_SHARED le_result_t ifgen_le_sim_GetICCID
628 (
629  le_msg_SessionRef_t _ifgen_sessionRef,
630  le_sim_Id_t simId,
631  ///< [IN] The SIM identifier.
632  char* iccid,
633  ///< [OUT] ICCID
634  size_t iccidSize
635  ///< [IN]
636 );
637 
638 //--------------------------------------------------------------------------------------------------
639 /**
640  * Retrieves the identifier for the embedded Universal Integrated Circuit Card identifier (EID)
641  * (32 digits)
642  *
643  * @return LE_OK EID was successfully retrieved.
644  * @return LE_OVERFLOW eidPtr buffer was too small for the EID.
645  * @return LE_BAD_PARAMETER Invalid parameters.
646  * @return LE_FAULT The EID could not be retrieved.
647  *
648  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
649  * function will not return.
650  *
651  * @warning le_sim_GetEID() function is platform dependent. Please refer to the
652  * @ref platformConstraintsSim_EID section for full details.
653  */
654 //--------------------------------------------------------------------------------------------------
655 LE_SHARED le_result_t ifgen_le_sim_GetEID
656 (
657  le_msg_SessionRef_t _ifgen_sessionRef,
658  le_sim_Id_t simId,
659  ///< [IN] The SIM identifier.
660  char* eid,
661  ///< [OUT] EID
662  size_t eidSize
663  ///< [IN]
664 );
665 
666 //--------------------------------------------------------------------------------------------------
667 /**
668  * Retrieves the identification number (IMSI) of the SIM card. (max 15 digits)
669  *
670  * @return LE_OVERFLOW The imsiPtr buffer was too small for the IMSI.
671  * @return LE_BAD_PARAMETER The parameters are invalid.
672  * @return LE_FAULT The function failed.
673  * @return LE_TIMEOUT No response was received.
674  * @return LE_OK The function succeeded.
675  *
676  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
677  * function will not return.
678  */
679 //--------------------------------------------------------------------------------------------------
680 LE_SHARED le_result_t ifgen_le_sim_GetIMSI
681 (
682  le_msg_SessionRef_t _ifgen_sessionRef,
683  le_sim_Id_t simId,
684  ///< [IN] The SIM identifier.
685  char* imsi,
686  ///< [OUT] IMSI
687  size_t imsiSize
688  ///< [IN]
689 );
690 
691 //--------------------------------------------------------------------------------------------------
692 /**
693  * Verify if the SIM card is present or not.
694  *
695  * @return true SIM card is present.
696  * @return false SIM card is absent
697  *
698  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
699  * function will not return.
700  */
701 //--------------------------------------------------------------------------------------------------
702 LE_SHARED bool ifgen_le_sim_IsPresent
703 (
704  le_msg_SessionRef_t _ifgen_sessionRef,
705  le_sim_Id_t simId
706  ///< [IN] The SIM identifier.
707 );
708 
709 //--------------------------------------------------------------------------------------------------
710 /**
711  * Verify if the SIM is ready (PIN code correctly inserted or not
712  * required).
713  *
714  * @return true PIN is correctly inserted or not required.
715  * @return false PIN must be inserted
716  *
717  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
718  * function will not return.
719  */
720 //--------------------------------------------------------------------------------------------------
721 LE_SHARED bool ifgen_le_sim_IsReady
722 (
723  le_msg_SessionRef_t _ifgen_sessionRef,
724  le_sim_Id_t simId
725  ///< [IN] The SIM identifier.
726 );
727 
728 //--------------------------------------------------------------------------------------------------
729 /**
730  * This function must be called to enter the PIN code.
731  *
732  * @return LE_BAD_PARAMETER The parameters are invalid.
733  * @return LE_NOT_FOUND The function failed to select the SIM card for this operation.
734  * @return LE_UNDERFLOW The PIN code is not long enough (min 4 digits).
735  * @return LE_FAULT The function failed to enter the PIN code.
736  * @return LE_OK The function succeeded.
737  *
738  * @note If PIN code is too long (max 8 digits), it is a fatal error, the
739  * function will not return.
740  *
741  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
742  * function will not return.
743  */
744 //--------------------------------------------------------------------------------------------------
745 LE_SHARED le_result_t ifgen_le_sim_EnterPIN
746 (
747  le_msg_SessionRef_t _ifgen_sessionRef,
748  le_sim_Id_t simId,
749  ///< [IN] The SIM identifier.
750  const char* LE_NONNULL pin
751  ///< [IN] The PIN code.
752 );
753 
754 //--------------------------------------------------------------------------------------------------
755 /**
756  * Change the PIN code.
757  *
758  * @return LE_NOT_FOUND Function failed to select the SIM card for this operation.
759  * @return LE_UNDERFLOW PIN code is/are not long enough (min 4 digits).
760  * @return LE_FAULT Function failed to change the PIN code.
761  * @return LE_OK Function succeeded.
762  *
763  * @note If PIN code is too long (max 8 digits), it is a fatal error, the
764  * function will not return.
765  *
766  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
767  * function will not return.
768  */
769 //--------------------------------------------------------------------------------------------------
770 LE_SHARED le_result_t ifgen_le_sim_ChangePIN
771 (
772  le_msg_SessionRef_t _ifgen_sessionRef,
773  le_sim_Id_t simId,
774  ///< [IN] The SIM identifier.
775  const char* LE_NONNULL oldpin,
776  ///< [IN] The old PIN code.
777  const char* LE_NONNULL newpin
778  ///< [IN] The new PIN code.
779 );
780 
781 //--------------------------------------------------------------------------------------------------
782 /**
783  * Get the number of remaining PIN insertion tries.
784  *
785  * @return LE_NOT_FOUND The function failed to select the SIM card for this operation.
786  * @return LE_BAD_PARAMETER Invalid SIM identifier.
787  * @return LE_FAULT The function failed to get the number of remaining PIN insertion tries.
788  * @return A positive value The function succeeded. The number of remaining PIN insertion tries.
789  *
790  */
791 //--------------------------------------------------------------------------------------------------
792 LE_SHARED int32_t ifgen_le_sim_GetRemainingPINTries
793 (
794  le_msg_SessionRef_t _ifgen_sessionRef,
795  le_sim_Id_t simId
796  ///< [IN] The SIM identifier.
797 );
798 
799 //--------------------------------------------------------------------------------------------------
800 /**
801  * Get the number of remaining PUK insertion tries.
802  *
803  * @return LE_OK On success.
804  * @return LE_NOT_FOUND The function failed to select the SIM card for this operation.
805  * @return LE_BAD_PARAMETER Invalid SIM identifier.
806  * @return LE_FAULT The function failed to get the number of remaining PUK insertion tries.
807  *
808  * @note If the caller is passing an null pointer to this function, it is a fatal error
809  * and the function will not return.
810  *
811  */
812 //--------------------------------------------------------------------------------------------------
813 LE_SHARED le_result_t ifgen_le_sim_GetRemainingPUKTries
814 (
815  le_msg_SessionRef_t _ifgen_sessionRef,
816  le_sim_Id_t simId,
817  ///< [IN] The SIM identifier.
818  uint32_t* remainingPukTriesPtrPtr
819  ///< [OUT] The number of remaining PUK insertion tries.
820 );
821 
822 //--------------------------------------------------------------------------------------------------
823 /**
824  * Unlock the SIM card: it disables the request of the PIN code.
825  *
826  * @return LE_NOT_FOUND Function failed to select the SIM card for this operation.
827  * @return LE_UNDERFLOW PIN code is not long enough (min 4 digits).
828  * @return LE_FAULT The function failed to unlock the SIM card.
829  * @return LE_OK Function succeeded.
830  *
831  * @note If PIN code is too long (max 8 digits), it is a fatal error, the
832  * function will not return.
833  *
834  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
835  * function will not return.
836  */
837 //--------------------------------------------------------------------------------------------------
838 LE_SHARED le_result_t ifgen_le_sim_Unlock
839 (
840  le_msg_SessionRef_t _ifgen_sessionRef,
841  le_sim_Id_t simId,
842  ///< [IN] The SIM identifier.
843  const char* LE_NONNULL pin
844  ///< [IN] The PIN code.
845 );
846 
847 //--------------------------------------------------------------------------------------------------
848 /**
849  * Lock the SIM card: it enables the request of the PIN code.
850  *
851  * @return LE_NOT_FOUND Function failed to select the SIM card for this operation.
852  * @return LE_UNDERFLOW PIN code is not long enough (min 4 digits).
853  * @return LE_FAULT The function failed to unlock the SIM card.
854  * @return LE_OK Function succeeded.
855  *
856  * @note If PIN code is too long (max 8 digits), it is a fatal error, the
857  * function will not return.
858  *
859  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
860  * function will not return.
861  */
862 //--------------------------------------------------------------------------------------------------
863 LE_SHARED le_result_t ifgen_le_sim_Lock
864 (
865  le_msg_SessionRef_t _ifgen_sessionRef,
866  le_sim_Id_t simId,
867  ///< [IN] The SIM identifier.
868  const char* LE_NONNULL pin
869  ///< [IN] The PIN code.
870 );
871 
872 //--------------------------------------------------------------------------------------------------
873 /**
874  * Unblock the SIM card.
875  *
876  * @return LE_NOT_FOUND Function failed to select the SIM card for this operation.
877  * @return LE_UNDERFLOW PIN code is not long enough (min 4 digits).
878  * @return LE_BAD_PARAMETER Invalid SIM identifier.
879  * @return LE_OUT_OF_RANGE PUK code length is not correct (8 digits).
880  * @return LE_FAULT The function failed to unlock the SIM card.
881  * @return LE_OK Function succeeded.
882  *
883  * @note If new PIN or puk code are too long (max 8 digits), it is a fatal error, the
884  * function will not return.
885  *
886  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
887  * function will not return.
888  */
889 //--------------------------------------------------------------------------------------------------
890 LE_SHARED le_result_t ifgen_le_sim_Unblock
891 (
892  le_msg_SessionRef_t _ifgen_sessionRef,
893  le_sim_Id_t simId,
894  ///< [IN] The SIM identifier.
895  const char* LE_NONNULL puk,
896  ///< [IN] The PUK code.
897  const char* LE_NONNULL newpin
898  ///< [IN] The PIN code.
899 );
900 
901 //--------------------------------------------------------------------------------------------------
902 /**
903  * Get the SIM state.
904  *
905  * @return Current SIM state.
906  *
907  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
908  * function will not return.
909  */
910 //--------------------------------------------------------------------------------------------------
911 LE_SHARED le_sim_States_t ifgen_le_sim_GetState
912 (
913  le_msg_SessionRef_t _ifgen_sessionRef,
914  le_sim_Id_t simId
915  ///< [IN] The SIM identifier.
916 );
917 
918 //--------------------------------------------------------------------------------------------------
919 /**
920  * Get the SIM Phone Number.
921  *
922  * @return
923  * - LE_OK on success
924  * - LE_OVERFLOW if the Phone Number can't fit in phoneNumberStr
925  * - LE_BAD_PARAMETER if a parameter is invalid
926  * - LE_FAULT on any other failure
927  *
928  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
929  * function will not return.
930  */
931 //--------------------------------------------------------------------------------------------------
932 LE_SHARED le_result_t ifgen_le_sim_GetSubscriberPhoneNumber
933 (
934  le_msg_SessionRef_t _ifgen_sessionRef,
935  le_sim_Id_t simId,
936  ///< [IN] The SIM identifier.
937  char* phoneNumberStr,
938  ///< [OUT] The phone Number.
939  size_t phoneNumberStrSize
940  ///< [IN]
941 );
942 
943 //--------------------------------------------------------------------------------------------------
944 /**
945  * This function must be called to get the Home Network Name information.
946  *
947  * @return
948  * - LE_OK on success
949  * - LE_OVERFLOW if the Home Network Name can't fit in nameStr
950  * - LE_BAD_PARAMETER if a parameter is invalid
951  * - LE_FAULT on any other failure
952  *
953  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
954  * function will not return.
955  *
956  * @note The home network name can be given even if the device is not registered on the network.
957  */
958 //--------------------------------------------------------------------------------------------------
959 LE_SHARED le_result_t ifgen_le_sim_GetHomeNetworkOperator
960 (
961  le_msg_SessionRef_t _ifgen_sessionRef,
962  le_sim_Id_t simId,
963  ///< [IN] The SIM identifier.
964  char* nameStr,
965  ///< [OUT] the home network Name
966  size_t nameStrSize
967  ///< [IN]
968 );
969 
970 //--------------------------------------------------------------------------------------------------
971 /**
972  * This function must be called to get the Home Network MCC MNC.
973  *
974  * @return
975  * - LE_OK on success
976  * - LE_NOT_FOUND if Home Network has not been provisioned
977  * - LE_FAULT for unexpected error
978  *
979  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
980  * function will not return.
981  */
982 //--------------------------------------------------------------------------------------------------
983 LE_SHARED le_result_t ifgen_le_sim_GetHomeNetworkMccMnc
984 (
985  le_msg_SessionRef_t _ifgen_sessionRef,
986  le_sim_Id_t simId,
987  ///< [IN] The SIM identifier.
988  char* mccPtr,
989  ///< [OUT] Mobile Country Code
990  size_t mccPtrSize,
991  ///< [IN]
992  char* mncPtr,
993  ///< [OUT] Mobile Network Code
994  size_t mncPtrSize
995  ///< [IN]
996 );
997 
998 //--------------------------------------------------------------------------------------------------
999 /**
1000  * This function must be called to request the multi-profile eUICC to swap to ECS and to refresh.
1001  * The User's application must wait for eUICC reboot to be finished and network connection
1002  * available.
1003  *
1004  * @return
1005  * - LE_OK on success
1006  * - LE_BAD_PARAMETER invalid SIM identifier
1007  * - LE_BUSY when a profile swap is already in progress
1008  * - LE_FAULT for unexpected error
1009  * - LE_DUPLICATE for duplicate operation
1010  *
1011  * @note Please ensure that the eUICC is selected using le_sim_SelectCard() and in a ready state
1012  * before attempting a profile swap.
1013  *
1014  * @warning If you use a Morpho or Oberthur card, the SIM_REFRESH PRO-ACTIVE command must be
1015  * accepted with le_sim_AcceptSimToolkitCommand() in order to complete the profile swap
1016  * procedure.
1017  */
1018 //--------------------------------------------------------------------------------------------------
1019 LE_SHARED le_result_t ifgen_le_sim_LocalSwapToEmergencyCallSubscription
1020 (
1021  le_msg_SessionRef_t _ifgen_sessionRef,
1022  le_sim_Id_t simId,
1023  ///< [IN] The SIM identifier.
1024  le_sim_Manufacturer_t manufacturer
1025  ///< [IN] The card manufacturer.
1026 );
1027 
1028 //--------------------------------------------------------------------------------------------------
1029 /**
1030  * This function must be called to request the multi-profile eUICC to swap back to commercial
1031  * subscription and to refresh.
1032  * The User's application must wait for eUICC reboot to be finished and network connection
1033  * available.
1034  *
1035  * @return
1036  * - LE_OK on success
1037  * - LE_BAD_PARAMETER invalid SIM identifier
1038  * - LE_BUSY when a profile swap is already in progress
1039  * - LE_FAULT for unexpected error
1040  * - LE_DUPLICATE for duplicate operation
1041  *
1042  * @note Please ensure that the eUICC is selected using le_sim_SelectCard() and in a ready state
1043  * before attempting a profile swap.
1044  *
1045  * @warning If you use a Morpho or Oberthur card, the SIM_REFRESH PRO-ACTIVE command must be
1046  * accepted with le_sim_AcceptSimToolkitCommand() in order to complete the profile swap
1047  * procedure.
1048  */
1049 //--------------------------------------------------------------------------------------------------
1050 LE_SHARED le_result_t ifgen_le_sim_LocalSwapToCommercialSubscription
1051 (
1052  le_msg_SessionRef_t _ifgen_sessionRef,
1053  le_sim_Id_t simId,
1054  ///< [IN] The SIM identifier.
1055  le_sim_Manufacturer_t manufacturer
1056  ///< [IN] The card manufacturer.
1057 );
1058 
1059 //--------------------------------------------------------------------------------------------------
1060 /**
1061  * This function must be called to get the current subscription.
1062  *
1063  * @return
1064  * - LE_OK on success
1065  * - LE_BAD_PARAMETER invalid SIM identifier or null ECS pointer is passed
1066  * - LE_NOT_FOUND cannot determine the current selected subscription
1067  * - LE_FAULT for unexpected errors
1068  *
1069  * @warning There is no standard method to interrogate the current selected subscription. The
1070  * returned value of this function is based on the last executed local swap command. This means
1071  * that this function will always return LE_NOT_FOUND error at Legato startup.
1072  */
1073 //--------------------------------------------------------------------------------------------------
1074 LE_SHARED le_result_t ifgen_le_sim_IsEmergencyCallSubscriptionSelected
1075 (
1076  le_msg_SessionRef_t _ifgen_sessionRef,
1077  le_sim_Id_t simId,
1078  ///< [IN] The SIM identifier
1079  bool* isEcsPtr
1080  ///< [OUT] true if Emergency Call Subscription (ECS) is selected,
1081  ///< false if Commercial Subscription is selected
1082 );
1083 
1084 //--------------------------------------------------------------------------------------------------
1085 /**
1086  * Accept the last SIM Toolkit command.
1087  *
1088  * @return
1089  * - LE_OK The function succeeded.
1090  * - LE_FAULT The function failed.
1091  */
1092 //--------------------------------------------------------------------------------------------------
1093 LE_SHARED le_result_t ifgen_le_sim_AcceptSimToolkitCommand
1094 (
1095  le_msg_SessionRef_t _ifgen_sessionRef,
1096  le_sim_Id_t simId
1097  ///< [IN] The SIM identifier.
1098 );
1099 
1100 //--------------------------------------------------------------------------------------------------
1101 /**
1102  * Reject the last SIM Toolkit command.
1103  *
1104  * @return
1105  * - LE_OK The function succeeded.
1106  * - LE_FAULT The function failed.
1107  */
1108 //--------------------------------------------------------------------------------------------------
1109 LE_SHARED le_result_t ifgen_le_sim_RejectSimToolkitCommand
1110 (
1111  le_msg_SessionRef_t _ifgen_sessionRef,
1112  le_sim_Id_t simId
1113  ///< [IN] The SIM identifier.
1114 );
1115 
1116 //--------------------------------------------------------------------------------------------------
1117 /**
1118  * Retrieve the mode of the last SIM Toolkit Refresh command.
1119  * The modes are defined in ETSI TS 102 223 sections 6.4.7 and 8.6.
1120  *
1121  * @return
1122  * - LE_OK The function succeeded.
1123  * - LE_BAD_PARAMETER A parameter is invalid.
1124  * - LE_UNAVAILABLE The last SIM Toolkit command is not a Refresh command.
1125  * - LE_FAULT The function failed.
1126  * - LE_UNSUPPORTED The platform does not support this operation.
1127  */
1128 //--------------------------------------------------------------------------------------------------
1129 LE_SHARED le_result_t ifgen_le_sim_GetSimToolkitRefreshMode
1130 (
1131  le_msg_SessionRef_t _ifgen_sessionRef,
1132  le_sim_Id_t simId,
1133  ///< [IN] The SIM identifier.
1134  le_sim_StkRefreshMode_t* refreshModePtr
1135  ///< [OUT] The Refresh mode.
1136 );
1137 
1138 //--------------------------------------------------------------------------------------------------
1139 /**
1140  * Retrieve the stage of the last SIM Toolkit Refresh command.
1141  *
1142  * @return
1143  * - LE_OK The function succeeded.
1144  * - LE_BAD_PARAMETER A parameter is invalid.
1145  * - LE_UNAVAILABLE The last SIM Toolkit command is not a Refresh command.
1146  * - LE_FAULT The function failed.
1147  */
1148 //--------------------------------------------------------------------------------------------------
1149 LE_SHARED le_result_t ifgen_le_sim_GetSimToolkitRefreshStage
1150 (
1151  le_msg_SessionRef_t _ifgen_sessionRef,
1152  le_sim_Id_t simId,
1153  ///< [IN] The SIM identifier.
1154  le_sim_StkRefreshStage_t* refreshStagePtr
1155  ///< [OUT] The Refresh stage.
1156 );
1157 
1158 //--------------------------------------------------------------------------------------------------
1159 /**
1160  * Send APDU command to the SIM.
1161  *
1162  * @return
1163  * - LE_OK Function succeeded.
1164  * - LE_FAULT The function failed.
1165  * - LE_BAD_PARAMETER A parameter is invalid.
1166  * - LE_NOT_FOUND The function failed to select the SIM card for this operation.
1167  */
1168 //--------------------------------------------------------------------------------------------------
1169 LE_SHARED le_result_t ifgen_le_sim_SendApdu
1170 (
1171  le_msg_SessionRef_t _ifgen_sessionRef,
1172  le_sim_Id_t simId,
1173  ///< [IN] The SIM identifier.
1174  const uint8_t* commandApduPtr,
1175  ///< [IN] APDU command.
1176  size_t commandApduSize,
1177  ///< [IN]
1178  uint8_t* responseApduPtr,
1179  ///< [OUT] SIM response.
1180  size_t* responseApduSizePtr
1181  ///< [INOUT]
1182 );
1183 
1184 //--------------------------------------------------------------------------------------------------
1185 /**
1186  * Send a command to the SIM.
1187  *
1188  * @return
1189  * - LE_OK Function succeeded.
1190  * - LE_FAULT The function failed.
1191  * - LE_BAD_PARAMETER A parameter is invalid.
1192  * - LE_NOT_FOUND - The function failed to select the SIM card for this operation
1193  * - The requested SIM file is not found
1194  * - LE_OVERFLOW Response buffer is too small to copy the SIM answer.
1195  * - LE_UNSUPPORTED The platform does not support this operation.
1196  */
1197 //--------------------------------------------------------------------------------------------------
1198 LE_SHARED le_result_t ifgen_le_sim_SendCommand
1199 (
1200  le_msg_SessionRef_t _ifgen_sessionRef,
1201  le_sim_Id_t simId,
1202  ///< [IN] The SIM identifier.
1203  le_sim_Command_t command,
1204  ///< [IN] The SIM command.
1205  const char* LE_NONNULL fileIdentifier,
1206  ///< [IN] File identifier
1207  uint8_t p1,
1208  ///< [IN] Parameter P1 passed to the SIM
1209  uint8_t p2,
1210  ///< [IN] Parameter P2 passed to the SIM
1211  uint8_t p3,
1212  ///< [IN] Parameter P3 passed to the SIM
1213  const uint8_t* dataPtr,
1214  ///< [IN] data command.
1215  size_t dataSize,
1216  ///< [IN]
1217  const char* LE_NONNULL path,
1218  ///< [IN] path of the elementary file
1219  uint8_t* sw1Ptr,
1220  ///< [OUT] Status Word 1 received from the SIM
1221  uint8_t* sw2Ptr,
1222  ///< [OUT] Status Word 2 received from the SIM
1223  uint8_t* responsePtr,
1224  ///< [OUT] SIM response.
1225  size_t* responseSizePtr
1226  ///< [INOUT]
1227 );
1228 
1229 //--------------------------------------------------------------------------------------------------
1230 /**
1231  * Enable or disable the automatic SIM selection
1232  *
1233  * @note Automatic SIM selection uses the following rule: If an external SIM is inserted in
1234  * slot 1 then select it. Otherwise, fall back to the internal SIM card.
1235  *
1236  * @return
1237  * - LE_OK Function succeeded.
1238  * - LE_FAULT Function failed to execute.
1239  *
1240  */
1241 //--------------------------------------------------------------------------------------------------
1242 LE_SHARED le_result_t ifgen_le_sim_SetAutomaticSelection
1243 (
1244  le_msg_SessionRef_t _ifgen_sessionRef,
1245  bool enable
1246  ///< [IN] True if the feature needs to be enabled. False otherwise.
1247 );
1248 
1249 //--------------------------------------------------------------------------------------------------
1250 /**
1251  * Get the automatic SIM selection
1252  *
1253  * @note When enabled, automatic SIM selection uses the following rule: If an external SIM is
1254  * inserted in slot 1 then select it. Otherwise, fall back to the internal SIM card.
1255  *
1256  * @return
1257  * - LE_OK Function succeeded.
1258  * - LE_FAULT Function failed to execute.
1259  * - LE_BAD_PARAMETER Invalid parameter.
1260  * - LE_UNSUPPORTED The platform does not support this operation.
1261  *
1262  */
1263 //--------------------------------------------------------------------------------------------------
1264 LE_SHARED le_result_t ifgen_le_sim_GetAutomaticSelection
1265 (
1266  le_msg_SessionRef_t _ifgen_sessionRef,
1267  bool* enablePtr
1268  ///< [OUT] True if the feature is enabled. False otherwise.
1269 );
1270 
1271 //--------------------------------------------------------------------------------------------------
1272 /**
1273  * Reset the SIM.
1274  *
1275  * @return
1276  * - LE_FAULT Function failed.
1277  * - LE_OK Function succeeded.
1278  */
1279 //--------------------------------------------------------------------------------------------------
1280 LE_SHARED le_result_t ifgen_le_sim_Reset
1281 (
1282  le_msg_SessionRef_t _ifgen_sessionRef,
1283  le_sim_Id_t simId
1284  ///< [IN] The SIM identifier.
1285 );
1286 
1287 //--------------------------------------------------------------------------------------------------
1288 /**
1289  * Create empty FPLMN list to insert FPLMN operators.
1290  *
1291  * @return
1292  * - Reference to the List object.
1293  * - Null pointer if not able to create list reference.
1294  */
1295 //--------------------------------------------------------------------------------------------------
1296 LE_SHARED le_sim_FPLMNListRef_t ifgen_le_sim_CreateFPLMNList
1297 (
1298  le_msg_SessionRef_t _ifgen_sessionRef
1299 );
1300 
1301 //--------------------------------------------------------------------------------------------------
1302 /**
1303  * Add FPLMN network into the newly created FPLMN list.
1304  * If the FPLMNListRef, mcc or mnc is not valid then this function will kill the calling client.
1305  *
1306  * @return
1307  * - LE_FAULT Function failed.
1308  * - LE_OK Function succeeded.
1309  * - LE_OVERFLOW If FPLMN operator can not be inserted into FPLMN list.
1310  */
1311 //--------------------------------------------------------------------------------------------------
1312 LE_SHARED le_result_t ifgen_le_sim_AddFPLMNOperator
1313 (
1314  le_msg_SessionRef_t _ifgen_sessionRef,
1315  le_sim_FPLMNListRef_t FPLMNListRef,
1316  ///< [IN] FPLMN list reference.
1317  const char* LE_NONNULL mcc,
1318  ///< [IN] Mobile Country Code.
1319  const char* LE_NONNULL mnc
1320  ///< [IN] Mobile Network Code.
1321 );
1322 
1323 //--------------------------------------------------------------------------------------------------
1324 /**
1325  * Write FPLMN list into the SIM.
1326  * If the FPLMNListRef is not valid then this function will kill the calling client.
1327  *
1328  * @return
1329  * - LE_FAULT Function failed.
1330  * - LE_OK Function succeeded.
1331  *
1332  */
1333 //--------------------------------------------------------------------------------------------------
1334 LE_SHARED le_result_t ifgen_le_sim_WriteFPLMNList
1335 (
1336  le_msg_SessionRef_t _ifgen_sessionRef,
1337  le_sim_Id_t simId,
1338  ///< [IN] The SIM identifier.
1339  le_sim_FPLMNListRef_t FPLMNListRef
1340  ///< [IN] FPLMN list reference.
1341 );
1342 
1343 //--------------------------------------------------------------------------------------------------
1344 /**
1345  * Read FPLMN list from the SIM.
1346  *
1347  * @return
1348  * - Reference to the List object.
1349  * - Null pointer if FPLMN list is not able to read from the SIM.
1350  */
1351 //--------------------------------------------------------------------------------------------------
1352 LE_SHARED le_sim_FPLMNListRef_t ifgen_le_sim_ReadFPLMNList
1353 (
1354  le_msg_SessionRef_t _ifgen_sessionRef,
1355  le_sim_Id_t simId
1356  ///< [IN] The SIM identifier.
1357 );
1358 
1359 //--------------------------------------------------------------------------------------------------
1360 /**
1361  * Read the first FPLMN network from the list of FPLMN objects retrieved with
1362  * le_sim_ReadFPLMNList().
1363  * If the FPLMNListRef, mccPtr or mncPtr is not valid then this function will kill the calling
1364  * client.
1365  *
1366  * @return
1367  * - LE_FAULT Function failed.
1368  * - LE_OK Function succeeded.
1369  * - LE_OVERFLOW MCC/MNC string size is greater than string length parameter which has
1370  * been given into this function.
1371  */
1372 //--------------------------------------------------------------------------------------------------
1373 LE_SHARED le_result_t ifgen_le_sim_GetFirstFPLMNOperator
1374 (
1375  le_msg_SessionRef_t _ifgen_sessionRef,
1376  le_sim_FPLMNListRef_t FPLMNListRef,
1377  ///< [IN] FPLMN list reference.
1378  char* mccPtr,
1379  ///< [OUT] Mobile Country Code.
1380  size_t mccPtrSize,
1381  ///< [IN]
1382  char* mncPtr,
1383  ///< [OUT] Mobile Network Code.
1384  size_t mncPtrSize
1385  ///< [IN]
1386 );
1387 
1388 //--------------------------------------------------------------------------------------------------
1389 /**
1390  * Read the next FPLMN network from the list of FPLMN objects retrieved with le_sim_ReadFPLMNList().
1391  * If the FPLMNListRef, mccPtr or mncPtr is not valid then this function will kill the calling
1392  * client.
1393  *
1394  * @return
1395  * - LE_FAULT Function failed.
1396  * - LE_OK Function succeeded.
1397  * - LE_OVERFLOW MCC/MNC string size is greater than string length parameter which has
1398  * been given into this function.
1399  */
1400 //--------------------------------------------------------------------------------------------------
1401 LE_SHARED le_result_t ifgen_le_sim_GetNextFPLMNOperator
1402 (
1403  le_msg_SessionRef_t _ifgen_sessionRef,
1404  le_sim_FPLMNListRef_t FPLMNListRef,
1405  ///< [IN] FPLMN list reference.
1406  char* mccPtr,
1407  ///< [OUT] Mobile Country Code.
1408  size_t mccPtrSize,
1409  ///< [IN]
1410  char* mncPtr,
1411  ///< [OUT] Mobile Network Code.
1412  size_t mncPtrSize
1413  ///< [IN]
1414 );
1415 
1416 //--------------------------------------------------------------------------------------------------
1417 /**
1418  * Delete the FPLMN list created by le_sim_ReadFPLMNList() or le_sim_CreateFPLMNList().
1419  * If the FPLMNListRef is not valid then this function will kill the calling client.
1420  *
1421  * @note
1422  * On failure, the process exits, so you don't have to worry about checking the returned
1423  * reference for validity.
1424  */
1425 //--------------------------------------------------------------------------------------------------
1426 LE_SHARED void ifgen_le_sim_DeleteFPLMNList
1427 (
1428  le_msg_SessionRef_t _ifgen_sessionRef,
1429  le_sim_FPLMNListRef_t FPLMNListRef
1430  ///< [IN] FPLMN list reference.
1431 );
1432 
1433 //--------------------------------------------------------------------------------------------------
1434 /**
1435  * Open a logical channel on the SIM card.
1436  *
1437  * @return
1438  * - LE_OK Function succeeded.
1439  * - LE_BAD_PARAMETER Invalid parameter.
1440  * - LE_FAULT Function failed.
1441  */
1442 //--------------------------------------------------------------------------------------------------
1443 LE_SHARED le_result_t ifgen_le_sim_OpenLogicalChannel
1444 (
1445  le_msg_SessionRef_t _ifgen_sessionRef,
1446  uint8_t* channelPtrPtr
1447  ///< [OUT] The number of the opened logical channel.
1448 );
1449 
1450 //--------------------------------------------------------------------------------------------------
1451 /**
1452  * Close a logical channel on the SIM card.
1453  *
1454  * @return
1455  * - LE_OK Function succeeded.
1456  * - LE_FAULT Function failed.
1457  */
1458 //--------------------------------------------------------------------------------------------------
1459 LE_SHARED le_result_t ifgen_le_sim_CloseLogicalChannel
1460 (
1461  le_msg_SessionRef_t _ifgen_sessionRef,
1462  uint8_t channel
1463  ///< [IN] The number of the logical channel to close.
1464 );
1465 
1466 //--------------------------------------------------------------------------------------------------
1467 /**
1468  * Send APDU command on a dedicated logical channel.
1469  *
1470  * @return
1471  * - LE_OK Function succeeded.
1472  * - LE_BAD_PARAMETER A parameter is invalid.
1473  * - LE_NOT_FOUND The function failed to select the SIM card for this operation.
1474  * - LE_FAULT The function failed.
1475  */
1476 //--------------------------------------------------------------------------------------------------
1477 LE_SHARED le_result_t ifgen_le_sim_SendApduOnChannel
1478 (
1479  le_msg_SessionRef_t _ifgen_sessionRef,
1480  le_sim_Id_t simId,
1481  ///< [IN] The SIM identifier.
1482  uint8_t channel,
1483  ///< [IN] The logical channel number.
1484  const uint8_t* commandApduPtr,
1485  ///< [IN] APDU command.
1486  size_t commandApduSize,
1487  ///< [IN]
1488  uint8_t* responseApduPtr,
1489  ///< [OUT] SIM response.
1490  size_t* responseApduSizePtr
1491  ///< [INOUT]
1492 );
1493 
1494 //--------------------------------------------------------------------------------------------------
1495 /**
1496  * Power up or down the current SIM.
1497  *
1498  * @return LE_OK Function succeeded.
1499  * @return LE_FAULT Function failed.
1500  *
1501  * @note For SIM power cycle operation, it must wait until SIM state is LE_SIM_POWER_DOWN
1502  * before powering on the SIM, otherwise power up SIM will fail.
1503  */
1504 //--------------------------------------------------------------------------------------------------
1505 LE_SHARED le_result_t ifgen_le_sim_SetPower
1506 (
1507  le_msg_SessionRef_t _ifgen_sessionRef,
1508  le_sim_Id_t simId,
1509  ///< [IN] The SIM identifier.
1510  le_onoff_t power
1511  ///< [IN] The power state.
1512 );
1513 /** @} **/
1514 #endif // LE_SIM_COMMON_H_INCLUDE_GUARD
#define LE_SHARED
Definition: le_basics.h:300
Unknown SIM Toolkit event.
Definition: le_sim_common.h:281
le_sim_States_t
Definition: le_sim_common.h:180
le_sim_Command_t
Definition: le_sim_common.h:254
le_result_t
Definition: le_basics.h:46
le_sim_StkEvent_t
Definition: le_sim_common.h:275
SIM card is blocked.
Definition: le_sim_common.h:188
void(* le_sim_SimToolkitEventHandlerFunc_t)(le_sim_Id_t simId, le_sim_StkEvent_t stkEvent, void *contextPtr)
Definition: le_sim_common.h:411
void(* le_sim_ProfileUpdateHandlerFunc_t)(le_sim_Id_t simId, le_sim_StkEvent_t stkEvent, void *contextPtr)
Definition: le_sim_common.h:395
SIM card is powered down.
Definition: le_sim_common.h:192
struct le_sim_FPLMNList * le_sim_FPLMNListRef_t
Definition: le_sim_common.h:171
Valid.
Definition: le_sim_common.h:241
Unknown SIM state.
Definition: le_sim_common.h:194
SIM card asks to open a logical channel.
Definition: le_sim_common.h:277
Gemalto.
Definition: le_sim_common.h:235
struct le_sim_IccidChangeHandler * le_sim_IccidChangeHandlerRef_t
Definition: le_sim_common.h:369
le_sim_StkRefreshStage_t
Definition: le_sim_common.h:326
Max value.
Definition: le_sim_common.h:264
Embedded SIM.
Definition: le_sim_common.h:208
SIM reset.
Definition: le_sim_common.h:302
Session reset.
Definition: le_sim_common.h:306
SIM card is inserted and unlocked.
Definition: le_sim_common.h:186
SIM inserted in external slot 2.
Definition: le_sim_common.h:212
Initialization.
Definition: le_sim_common.h:300
SIM card is inserted and locked.
Definition: le_sim_common.h:182
le_sim_Manufacturer_t
Definition: le_sim_common.h:231
SIM card is busy.
Definition: le_sim_common.h:190
le_sim_StkRefreshMode_t
Definition: le_sim_common.h:292
Morpho.
Definition: le_sim_common.h:239
Steering of Roaming as defined in 3GPP TS 23.122.
Definition: le_sim_common.h:308
G&D.
Definition: le_sim_common.h:237
eUICC Profile State Change.
Definition: le_sim_common.h:313
Invalid SIM Toolkit Refresh mode.
Definition: le_sim_common.h:315
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
Application reset.
Definition: le_sim_common.h:304
Oberthur.
Definition: le_sim_common.h:233
void(* le_sim_IccidChangeHandlerFunc_t)(le_sim_Id_t simId, const char *LE_NONNULL iccid, void *contextPtr)
Definition: le_sim_common.h:427
Refresh failed.
Definition: le_sim_common.h:332
Update a transparent elementary file.
Definition: le_sim_common.h:262
Update a file record.
Definition: le_sim_common.h:260
Definition: le_sim_common.h:216
Read a transparent elementary file.
Definition: le_sim_common.h:258
SIM card asks for a refresh.
Definition: le_sim_common.h:279
Initialization and Full File Change Notification.
Definition: le_sim_common.h:294
struct le_sim_NewStateHandler * le_sim_NewStateHandlerRef_t
Definition: le_sim_common.h:345
struct le_sim_ProfileUpdateHandler * le_sim_ProfileUpdateHandlerRef_t
Definition: le_sim_common.h:353
struct le_sim_SimToolkitEventHandler * le_sim_SimToolkitEventHandlerRef_t
Definition: le_sim_common.h:361
Invalid SIM Toolkit Refresh stage.
Definition: le_sim_common.h:334
SIM card is absent.
Definition: le_sim_common.h:184
Read a file record.
Definition: le_sim_common.h:256
le_sim_Id_t
Definition: le_sim_common.h:206
Refresh succeeded.
Definition: le_sim_common.h:330
Waiting for OK to refresh.
Definition: le_sim_common.h:328
Remote SIM.
Definition: le_sim_common.h:214
SIM inserted in external slot 1.
Definition: le_sim_common.h:210
void(* le_sim_NewStateHandlerFunc_t)(le_sim_Id_t simId, le_sim_States_t simState, void *contextPtr)
Definition: le_sim_common.h:379
Initialization and File Change Notification.
Definition: le_sim_common.h:298
Definition: le_sim_common.h:310
File Change Notification.
Definition: le_sim_common.h:296
le_onoff_t
Definition: le_basics.h:98