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