le_mdc_interface.h

Go to the documentation of this file.
1 
2 
3 /*
4  * ====================== WARNING ======================
5  *
6  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
7  * DO NOT MODIFY IN ANY WAY.
8  *
9  * ====================== WARNING ======================
10  */
11 
12 /**
13  * @page c_mdc Modem Data Control
14  *
15  * @ref le_mdc_interface.h "API Reference"
16  *
17  * <HR>
18  *
19  * A data session is useful for applications that need to send or receive data over a network
20  * where SMS messages are insufficient. To start a data session, a data profile must
21  * be configured as specified by the target network.
22  *
23  * The Modem Data Control (mdc) API is used to manage data profiles and data sessions.
24  *
25  * @section le_mdc_binding IPC interfaces binding
26  *
27  * All the functions of this API are provided by the @b modemService service.
28  *
29  * Here's a code sample binding to modem services:
30  * @verbatim
31  bindings:
32  {
33  clientExe.clientComponent.le_mdc -> modemService.le_mdc
34  }
35  @endverbatim
36  *
37  * @section le_mdc_profile Data Profiles
38  *
39  * If a pre-defined data profile has been configured then this profile can
40  * be loaded using le_mdc_GetProfile().
41  * le_mdc_GetProfile() must be called with @c LE_MDC_DEFAULT_PROFILE to retrieve the default index
42  * used by the modem for data connection.
43  * le_mdc_GetProfile() must be called with @c LE_MDC_SIMTOOLKIT_BIP_DEFAULT_PROFILE to retrieve the
44  * default index used by the modem for Bearer Independent Protocol (BIP).
45  * The maximum number of data profiles supported is modem dependent and can be retrieved with
46  * le_mdc_NumProfiles().
47  *
48  * @note le_mdc_GetProfile() creates a new profile if the profile's index can't be found.
49  *
50  * @warning 0 is not a valid index.
51  *
52  * A pre-defined data profile can be retrieved using le_mdc_GetProfileFromApn() thanks to its
53  * APN.
54  *
55  * A default APN can be set for a defined profile with le_mdc_SetDefaultAPN(), based on the SIM
56  * identification number (ICCID). If no match is found in the database using the ICCID, the search
57  * falls back on the home network (MCC/MNC) to determine the default APN.
58  *
59  * @warning Ensure to check the list of supported data profiles for your specific platform.
60  *
61  * The following data profile parameters can be retrieved:
62  * - Packet Data Protocol using le_mdc_GetPDP().
63  * - Access Point Name using le_mdc_GetAPN().
64  * - Authentication settings using le_mdc_GetAuthentication().
65  *
66  * The following data profile parameters can be set:
67  * - Packet Data Protocol using le_mdc_SetPDP().
68  * - Access Point Name using le_mdc_SetAPN().
69  * - Authentication settings using le_mdc_SetAuthentication().
70  *
71  * @warning The maximum APN length might be limited by the platform.
72  * Please refer to the platform documentation.
73  *
74  * A sample code can be seen in the following page:
75  * - @subpage c_mdcDataProfiles
76  *
77  * @section le_mdc_session Data Sessions
78  *
79  * @subsection le_mdc_session_MO Mobile Originated (MO-PDP context activation)
80  *
81  * le_mdc_MapProfileOnNetworkInterface() may be used to map a data session with a network interface.
82  * To take effect, this API has to be called before starting the data session. Otherwise, the
83  * mapping will be taken into account at the next start of the data profile.
84  *
85  * A data session can be started using le_mdc_StartSession(). To start a data session, a
86  * data profile must be created and written to the modem, or an existing data profile
87  * can be used. A data session can be stopped using le_mdc_StopSession(). The number of
88  * simultaneous data sessions supported is dependent on the modem, but cannot be more than the
89  * maximum number of supported profiles.
90  *
91  * A data session can be started using le_mdc_StartSessionAsync() and stopped using
92  * le_mdc_StopSessionAsync(). These functions are not blocking. The response will be returned
93  * with the @c le_mdc_SessionHandlerFunc_t handler function.
94  *
95  * The current state of a data session can be queried using le_mdc_GetSessionState(). An application
96  * can also a register handler to be notified when the session state changes. The handler
97  * can be managed using le_mdc_AddSessionStateHandler() and le_mdc_RemoveSessionStateHandler().
98  *
99  * @subsection le_mdc_session_MT Mobile Terminated (MT-PDP context activation)
100  * To be notified by the MT-PDP context request, the application has to subscribe to the state
101  * handler using le_mdc_AddMtPdpSessionStateHandler().
102  * When the incoming MT-PDP context request is notified,
103  * the application takes responsibility to trigger the data session for that MT PDP request using
104  * le_mdc_StartSession(). That data session can be stopped using le_mdc_StopSession().
105  *
106  * The network interface settings of that MT-PDP context can be retrieved using the provided
107  * Data Profile.
108  * Please refer to @ref le_mdc_session_networkItf.
109  *
110  * A data session can be rejected using le_mdc_RejectMtPdpSession().
111  * The number of simultaneous data sessions supported is dependent on the modem,
112  * but cannot be more than the maximum number of supported profiles.
113  *
114  * The handler can be released using le_mdc_RemoveMtPdpSessionStateHandler().
115  *
116  * @warning The MT-PDP context activation feature is not supported on all platforms. Please refer to
117  * @ref MT-PDP_context section for full details.
118  *
119  * @subsection le_mdc_session_networkItf Network interface settings
120  * Once a data session starts, a Linux network interface is created. It's the application's
121  * responsibility to configure the network interface, usually through a DHCP client. Query the
122  * interface name using le_mdc_GetInterfaceName(). The IP Preference can be checked with
123  * le_mdc_IsIPv4() or le_mdc_IsIPv6() when the profile is connected. The IP address for the
124  * current data session
125  * can be retrieved by le_mdc_GetIPv4Address() or le_mdc_GetIPv6Address(). The Gateway and
126  * DNS
127  * addresses can be retrieved using le_mdc_GetIPv4GatewayAddress(),
128  * le_mdc_GetIPv4DNSAddresses() or le_mdc_GetIPv6GatewayAddress(), le_mdc_GetIPv6DNSAddresses().
129  * The Access Point Name can be retrieved by le_mdc_GetAPN(). The Data bearer
130  * Technology can be retrieved by le_mdc_GetDataBearerTechnology().
131  *
132  * le_mdc_GetDisconnectionReason() or le_mdc_GetPlatformSpecificDisconnectionCode() let you get
133  * the reason for disconnection of data session by retrieving the call end failure code
134  * from @c le_mdc_ProfileRef_t.
135  *
136  * le_mdc_GetPlatformSpecificFailureConnectionReason() let you get the data session connection
137  * failure reason by retrieving the call connection failure code and type from
138  * @c le_mdc_ProfileRef_t.
139  *
140  * Please refer to @ref platformConstraintsSpecificErrorCodes for platform specific
141  * disconnection code description.
142  *
143  * A sample code can be seen in the following page:
144  * - @subpage c_mdcDataSessions
145  *
146  * The following extended functions should be used to get the disconnection reason instead.
147  * A pdpType parameter is required to specify which session's(IPv4 or IPv6 session) disconnect
148  * reason to get for IPv4v6 mode. For IPv4 and IPv6 mode, the pdpType is ignored because there
149  * is only one session.
150  * - le_mdc_GetDisconnectionReasonExt()
151  * - le_mdc_GetPlatformSpecificDisconnectionCodeExt()
152  * - le_mdc_GetPlatformSpecificFailureConnectionReasonExt()
153  *
154  * @section le_mdc_dataStatistics Data Statistics
155  *
156  * The amount of received and transmitted data can be retrieved through le_mdc_GetBytesCounters().
157  * The returned values correspond to the number of received and transmitted
158  * bytes since the last call to le_mdc_ResetBytesCounter().
159  *
160  * The data statistics collection can be enabled with le_mdc_StartBytesCounter() and disabled
161  * without resetting the counters with le_mdc_StopBytesCounter().
162  *
163  * @note The data statistics collection activation and the data counters are persistent even after
164  * a reboot of the platform.
165  *
166  * A sample code can be seen in the following page:
167  * - @subpage c_mdcDataStatistics
168  *
169  * <HR>
170  *
171  * Copyright (C) Sierra Wireless Inc.
172  */
173 /**
174  * @page c_mdcDataProfiles Sample code for Data Profiles
175  *
176  * @snippet "apps/test/modemServices/mdc/mdcIntegrationTest/mdcTestComp/mdcTest.c" Profiles
177  */
178 /**
179  * @page c_mdcDataSessions Sample code for network interface settings
180  *
181  * @snippet "apps/test/modemServices/mdc/mdcIntegrationTest/mdcTestComp/mdcTest.c" Sessions
182  */
183 /**
184  * @page c_mdcDataStatistics Sample code for Data Statistics
185  *
186  * @snippet "apps/test/modemServices/mdc/mdcIntegrationTest/mdcTestComp/mdcTest.c" Statistics
187  */
188 /**
189  * @file le_mdc_interface.h
190  *
191  * Legato @ref c_mdc include file.
192  *
193  * Copyright (C) Sierra Wireless Inc.
194  */
195 
196 #ifndef LE_MDC_INTERFACE_H_INCLUDE_GUARD
197 #define LE_MDC_INTERFACE_H_INCLUDE_GUARD
198 
199 
200 #include "legato.h"
201 
202 
203 //--------------------------------------------------------------------------------------------------
204 /**
205  * Type for handler called when a server disconnects.
206  */
207 //--------------------------------------------------------------------------------------------------
208 typedef void (*le_mdc_DisconnectHandler_t)(void *);
209 
210 //--------------------------------------------------------------------------------------------------
211 /**
212  *
213  * Connect the current client thread to the service providing this API. Block until the service is
214  * available.
215  *
216  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
217  * called before any other functions in this API. Normally, ConnectService is automatically called
218  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
219  *
220  * This function is created automatically.
221  */
222 //--------------------------------------------------------------------------------------------------
224 (
225  void
226 );
227 
228 //--------------------------------------------------------------------------------------------------
229 /**
230  *
231  * Try to connect the current client thread to the service providing this API. Return with an error
232  * if the service is not available.
233  *
234  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
235  * called before any other functions in this API. Normally, ConnectService is automatically called
236  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
237  *
238  * This function is created automatically.
239  *
240  * @return
241  * - LE_OK if the client connected successfully to the service.
242  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
243  * bound.
244  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
245  * - LE_COMM_ERROR if the Service Directory cannot be reached.
246  */
247 //--------------------------------------------------------------------------------------------------
249 (
250  void
251 );
252 
253 //--------------------------------------------------------------------------------------------------
254 /**
255  * Set handler called when server disconnection is detected.
256  *
257  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
258  * to continue without exiting, it should call longjmp() from inside the handler.
259  */
260 //--------------------------------------------------------------------------------------------------
262 (
263  le_mdc_DisconnectHandler_t disconnectHandler,
264  void *contextPtr
265 );
266 
267 //--------------------------------------------------------------------------------------------------
268 /**
269  *
270  * Disconnect the current client thread from the service providing this API.
271  *
272  * Normally, this function doesn't need to be called. After this function is called, there's no
273  * longer a connection to the service, and the functions in this API can't be used. For details, see
274  * @ref apiFilesC_client.
275  *
276  * This function is created automatically.
277  */
278 //--------------------------------------------------------------------------------------------------
280 (
281  void
282 );
283 
284 
285 //--------------------------------------------------------------------------------------------------
286 /**
287  * Maximum number of bytes in a interface name (not including the null-terminator).
288  */
289 //--------------------------------------------------------------------------------------------------
290 #define LE_MDC_INTERFACE_NAME_MAX_LEN 20
291 
292 //--------------------------------------------------------------------------------------------------
293 /**
294  * Maximum number of bytes in a profile name (including the null-terminator).
295  */
296 //--------------------------------------------------------------------------------------------------
297 #define LE_MDC_INTERFACE_NAME_MAX_BYTES 21
298 
299 //--------------------------------------------------------------------------------------------------
300 /**
301  * Maximum number of bytes in an IPv4 address (not including the null-terminator).
302  */
303 //--------------------------------------------------------------------------------------------------
304 #define LE_MDC_IPV4_ADDR_MAX_LEN 15
305 
306 //--------------------------------------------------------------------------------------------------
307 /**
308  * Maximum number of bytes in an IPv4 address (including the null-terminator).
309  */
310 //--------------------------------------------------------------------------------------------------
311 #define LE_MDC_IPV4_ADDR_MAX_BYTES 16
312 
313 //--------------------------------------------------------------------------------------------------
314 /**
315  * Maximum number of bytes in an IPv6 address (not including the null-terminator).
316  */
317 //--------------------------------------------------------------------------------------------------
318 #define LE_MDC_IPV6_ADDR_MAX_LEN 45
319 
320 //--------------------------------------------------------------------------------------------------
321 /**
322  * Maximum number of bytes in an IPv6 address (including the null-terminator).
323  */
324 //--------------------------------------------------------------------------------------------------
325 #define LE_MDC_IPV6_ADDR_MAX_BYTES 46
326 
327 //--------------------------------------------------------------------------------------------------
328 /**
329  * Maximum number of bytes in a apn name (not including the null-terminator).
330  */
331 //--------------------------------------------------------------------------------------------------
332 #define LE_MDC_APN_NAME_MAX_LEN 100
333 
334 //--------------------------------------------------------------------------------------------------
335 /**
336  * Maximum number of bytes in a apn name (including the null-terminator).
337  */
338 //--------------------------------------------------------------------------------------------------
339 #define LE_MDC_APN_NAME_MAX_BYTES 101
340 
341 //--------------------------------------------------------------------------------------------------
342 /**
343  * Maximum number of bytes in a user name (not including the null-terminator).
344  */
345 //--------------------------------------------------------------------------------------------------
346 #define LE_MDC_USER_NAME_MAX_LEN 64
347 
348 //--------------------------------------------------------------------------------------------------
349 /**
350  * Maximum number of bytes in a user name (including the null-terminator).
351  */
352 //--------------------------------------------------------------------------------------------------
353 #define LE_MDC_USER_NAME_MAX_BYTES 65
354 
355 //--------------------------------------------------------------------------------------------------
356 /**
357  * Maximum number of bytes in a password name (not including the null-terminator).
358  */
359 //--------------------------------------------------------------------------------------------------
360 #define LE_MDC_PASSWORD_NAME_MAX_LEN 100
361 
362 //--------------------------------------------------------------------------------------------------
363 /**
364  * Maximum number of bytes in a password name (including the null-terminator).
365  */
366 //--------------------------------------------------------------------------------------------------
367 #define LE_MDC_PASSWORD_NAME_MAX_BYTES 101
368 
369 //--------------------------------------------------------------------------------------------------
370 /**
371  * Default profile definition.
372  */
373 //--------------------------------------------------------------------------------------------------
374 #define LE_MDC_DEFAULT_PROFILE -1
375 
376 //--------------------------------------------------------------------------------------------------
377 /**
378  * Default profile definition for Bearer Independent Protocol (BIP).
379  */
380 //--------------------------------------------------------------------------------------------------
381 #define LE_MDC_SIMTOOLKIT_BIP_DEFAULT_PROFILE -2
382 
383 //--------------------------------------------------------------------------------------------------
384 /**
385  * @deprecated LE_MDC_DISC_USER_AUTHENTIFICATION_FAILURE is deprecated.
386  * LE_MDC_DISC_USER_AUTHENTICATION_FAILURE should be used instead.
387  */
388 //--------------------------------------------------------------------------------------------------
389 #define LE_MDC_DISC_USER_AUTHENTIFICATION_FAILURE 7
390 
391 //--------------------------------------------------------------------------------------------------
392 /**
393  * Define the max # of entries in a profile list.
394  *
395  */
396 //--------------------------------------------------------------------------------------------------
397 #define LE_MDC_PROFILE_LIST_ENTRY_MAX 255
398 
399 //--------------------------------------------------------------------------------------------------
400 /**
401  */
402 //--------------------------------------------------------------------------------------------------
403 #define LE_MDC_PROFILE_LIST_ENTRY_NAMELEN_MAX 50
404 
405 //--------------------------------------------------------------------------------------------------
406 /**
407  * Reference to a modem data connection profile.
408  */
409 //--------------------------------------------------------------------------------------------------
410 typedef struct le_mdc_Profile* le_mdc_ProfileRef_t;
411 
412 
413 //--------------------------------------------------------------------------------------------------
414 /**
415  * Enumeration of data bearer technologies.
416  */
417 //--------------------------------------------------------------------------------------------------
418 typedef enum
419 {
421  ///< Unknown
423  ///< GSM
425  ///< GPRS
427  ///< Enhanced GPRS (EDGE)
429  ///< WCDMA (UMTS)
431  ///< HSPA
433  ///< HSPA+
435  ///< Dual Cell - HSPA+
437  ///< HSDPA
439  ///< HSUPA
441  ///< Dual Cell - HSUPA
443  ///< Dual Cell - HSPA
445  ///< LTE
447  ///< LTE FDD
449  ///< LTE TDD
451  ///< LTE CA DL
453  ///< LTE CA UL
455  ///< TD-SCDMA
457  ///< CDMA2000 1X
459  ///< CDMA2000 HRPD (1xEV-DO)
461  ///< CDMA2000 HRPD (1xEV-DO RevA)
463  ///< CDMA2000 EHRPD
465  ///< IS95 1X
467  ///< HDR REV0 DPA
469  ///< HDR REVA DPA
471  ///< HDR REVB DPA
473  ///< HDR REVA MPA
475  ///< HDR REVB MPA
477  ///< HDR REVA EMPA
479  ///< HDR REVB EMPA
481  ///< HDR REVB MMPA
483  ///< HDR EVDO FMC
485  ///< 64 QAM
487  ///< S2B
488 }
490 
491 
492 //--------------------------------------------------------------------------------------------------
493 /**
494  * Enumeration of Packet Data Protocol.
495  */
496 //--------------------------------------------------------------------------------------------------
497 typedef enum
498 {
500  ///< Unknown
502  ///< IPv4
504  ///< IPv6
506  ///< IPv4 and IPv6
507 }
509 
510 
511 //--------------------------------------------------------------------------------------------------
512 /**
513  * Authentication bit mask.
514  */
515 //--------------------------------------------------------------------------------------------------
516 typedef enum
517 {
518  LE_MDC_AUTH_NONE = 0x1, ///< no authentication
519  LE_MDC_AUTH_PAP = 0x2, ///< PAP protocol
520  LE_MDC_AUTH_CHAP = 0x4 ///< CHAP protocol
521 }
523 
524 
525 //--------------------------------------------------------------------------------------------------
526 /**
527  * Enumeration of connection state.
528  */
529 //--------------------------------------------------------------------------------------------------
530 typedef enum
531 {
533  ///< Data session is disconnected
535  ///< Authenticating data session
537  ///< Data session is connected
539  ///< Suspending data session
541  ///< Incoming data session (MT-PDP context request)
542 }
544 
545 
546 //--------------------------------------------------------------------------------------------------
547 /**
548  * Enumeration of the possible reasons for the disconnection.
549  */
550 //--------------------------------------------------------------------------------------------------
551 typedef enum
552 {
554  ///< Modem has no service
556  ///< cf. 3GPP 24.008 Annex I1
558  ///< cf. 3GPP 24.008 Annex I1
560  ///< cf. 3GPP 24.008 Annex I1
562  ///< cf. 3GPP 24.008 Annex I1
564  ///< cf. 3GPP 24.008 Annex I1
566  ///< cf. 3GPP 24.008 Annex I1
568  ///< cf. 3GPP 24.008 Annex I1
570  ///< cf. 3GPP 24.008 Annex I1
572  ///< cf. 3GPP 24.008 Annex I1
574  ///< cf. 3GPP 24.008 Annex I1
576  ///< cf. 3GPP 24.008 Annex I1
578  ///< cf. 3GPP 24.008 Annex I1
580  ///< cf. 3GPP 24.008 Annex I1
582  ///< cf. 3GPP 24.008 Annex I1
584  ///< cf. 3GPP 24.008 Annex I1
586  ///< cf. 3GPP 24.008 Annex I1
588  ///< cf. 3GPP 24.008 Annex I1
590  ///< cf. 3GPP 24.008 Annex I1
592  ///< cf. 3GPP 24.008 Annex I1
594  ///< cf. 3GPP 24.008 Annex I1
596  ///< cf. 3GPP 24.008 Annex I1
598  ///< cf. 3GPP 24.008 Annex I1
600  ///< cf. 3GPP 24.008 Annex I1
602  ///< cf. 3GPP 24.008 Annex I1
604  ///< cf. 3GPP 24.008 Annex I1
606  ///< cf. 3GPP 24.008 Annex I1
608  ///< cf. 3GPP 24.008 Annex I1
610  ///< cf. 3GPP 24.008 Annex I1
612  ///< cf. 3GPP 24.008 Annex I1
614  ///< cf. 3GPP 24.008 Annex I1
616  ///< cf. 3GPP 24.008 Annex I1
618  ///< cf. 3GPP 24.008 Annex I1
620  ///< cf. 3GPP 24.008 Annex I1
622  ///< cf. 3GPP 24.008 Annex I1
624  ///< cf. 3GPP 24.008 Annex I2
626  ///< cf. 3GPP 24.008 Annex I2
628  ///< cf. 3GPP 24.008 Annex I2
630  ///< cf. 3GPP 24.008 Annex I2
632  ///< cf. 3GPP 24.008 Annex I2
634  ///< cf. 3GPP 24.008 Annex I2
636  ///< cf. 3GPP 24.008 Annex I2
638  ///< cf. 3GPP 24.008 Annex I2
640  ///< cf. 3GPP 24.008 Annex I2
642  ///< Platform specific code.
644  ///< Undefined reason.
645 }
647 
648 
649 //--------------------------------------------------------------------------------------------------
650 /**
651  * Reference type used by Add/Remove functions for EVENT 'le_mdc_SessionState'
652  */
653 //--------------------------------------------------------------------------------------------------
654 typedef struct le_mdc_SessionStateHandler* le_mdc_SessionStateHandlerRef_t;
655 
656 
657 //--------------------------------------------------------------------------------------------------
658 /**
659  * Reference type used by Add/Remove functions for EVENT 'le_mdc_MtPdpSessionState'
660  */
661 //--------------------------------------------------------------------------------------------------
662 typedef struct le_mdc_MtPdpSessionStateHandler* le_mdc_MtPdpSessionStateHandlerRef_t;
663 
664 
665 //--------------------------------------------------------------------------------------------------
666 /**
667  * This is the structure with info about a given cellular data profile
668  */
669 //--------------------------------------------------------------------------------------------------
670 typedef struct
671 {
672  char name[50];
673  uint8_t index;
674  uint8_t type;
675 }
677 
678 
679 //--------------------------------------------------------------------------------------------------
680 /**
681  * Handler for Data session connection state changes.
682  */
683 //--------------------------------------------------------------------------------------------------
684 typedef void (*le_mdc_SessionStateHandlerFunc_t)
685 (
686  le_mdc_ProfileRef_t profileRef,
687  ///< Profile reference
688  le_mdc_ConState_t ConnectionState,
689  ///< Data session connection state.
690  void* contextPtr
691  ///<
692 );
693 
694 //--------------------------------------------------------------------------------------------------
695 /**
696  * Handler for MT-PDP Data session connection state changes.
697  */
698 //--------------------------------------------------------------------------------------------------
700 (
701  le_mdc_ConState_t ConnectionState,
702  ///< MT-PDP Data session connection state.
703  void* contextPtr
704  ///<
705 );
706 
707 //--------------------------------------------------------------------------------------------------
708 /**
709  * Handler for asynchronous session start and stop result response
710  *
711  */
712 //--------------------------------------------------------------------------------------------------
713 typedef void (*le_mdc_SessionHandlerFunc_t)
714 (
715  le_mdc_ProfileRef_t profileRef,
716  ///< Profile reference
717  le_result_t result,
718  ///< Session start or stop result response
719  void* contextPtr
720  ///<
721 );
722 
723 //--------------------------------------------------------------------------------------------------
724 /**
725  * Add handler function for EVENT 'le_mdc_SessionState'
726  *
727  * This event provides information on data session connection state changes for the given profileRef.
728  *
729  */
730 //--------------------------------------------------------------------------------------------------
732 (
733  le_mdc_ProfileRef_t profileRef,
734  ///< [IN] The profile object of interest
736  ///< [IN]
737  void* contextPtr
738  ///< [IN]
739 );
740 
741 //--------------------------------------------------------------------------------------------------
742 /**
743  * Remove handler function for EVENT 'le_mdc_SessionState'
744  */
745 //--------------------------------------------------------------------------------------------------
747 (
749  ///< [IN]
750 );
751 
752 //--------------------------------------------------------------------------------------------------
753 /**
754  * Add handler function for EVENT 'le_mdc_MtPdpSessionState'
755  *
756  * This event provides information on data session connection state changes for the given profileRef.
757  *
758  */
759 //--------------------------------------------------------------------------------------------------
761 (
763  ///< [IN]
764  void* contextPtr
765  ///< [IN]
766 );
767 
768 //--------------------------------------------------------------------------------------------------
769 /**
770  * Remove handler function for EVENT 'le_mdc_MtPdpSessionState'
771  */
772 //--------------------------------------------------------------------------------------------------
774 (
776  ///< [IN]
777 );
778 
779 //--------------------------------------------------------------------------------------------------
780 /**
781  * Get Profile Reference for index
782  *
783  * @note Create a new profile if the profile's index can't be found.
784  *
785  * @warning 0 is not a valid index.
786  *
787  * @warning Ensure to check the list of supported data profiles for your specific platform.
788  *
789  * @return
790  * - Reference to the data profile
791  * - NULL if the profile index does not exist
792  */
793 //--------------------------------------------------------------------------------------------------
795 (
796  uint32_t index
797  ///< [IN] index of the profile.
798 );
799 
800 //--------------------------------------------------------------------------------------------------
801 /**
802  * Get the index for the given Profile.
803  *
804  * @return
805  * - index of the profile in the modem
806  *
807  * @note
808  * The process exits, if an invalid profile object is given
809  */
810 //--------------------------------------------------------------------------------------------------
811 uint32_t le_mdc_GetProfileIndex
812 (
813  le_mdc_ProfileRef_t profileRef
814  ///< [IN] Query this profile object
815 );
816 
817 //--------------------------------------------------------------------------------------------------
818 /**
819  * Start profile data session.
820  *
821  * @return
822  * - LE_OK on success
823  * - LE_BAD_PARAMETER if input parameter is incorrect
824  * - LE_DUPLICATE if the data session is already connected for the given profile
825  * - LE_FAULT for other failures
826  *
827  * @note
828  * The process exits, if an invalid profile object is given
829  */
830 //--------------------------------------------------------------------------------------------------
832 (
833  le_mdc_ProfileRef_t profileRef
834  ///< [IN] Start data session for this profile object
835 );
836 
837 //--------------------------------------------------------------------------------------------------
838 /**
839  * Start profile data session.
840  *
841  * @note
842  * The process exits, if an invalid profile object is given
843  */
844 //--------------------------------------------------------------------------------------------------
846 (
847  le_mdc_ProfileRef_t profileRef,
848  ///< [IN] Start data session for this profile object
849  le_mdc_SessionHandlerFunc_t handlerPtr,
850  ///< [IN] Handler for start data session result
851  void* contextPtr
852  ///< [IN]
853 );
854 
855 //--------------------------------------------------------------------------------------------------
856 /**
857  * Stop profile data session.
858  *
859  * @return
860  * - LE_OK on success
861  * - LE_BAD_PARAMETER if the input parameter is not valid
862  * - LE_FAULT for other failures
863  *
864  * @note
865  * The process exits, if an invalid profile object is given
866  *
867  * @warning The MT-PDP context activation feature is not supported on all platforms. Please refer to
868  * @ref MT-PDP_context section for full details.
869  */
870 //--------------------------------------------------------------------------------------------------
872 (
873  le_mdc_ProfileRef_t profileRef
874  ///< [IN] Stop data session for this profile object
875 );
876 
877 //--------------------------------------------------------------------------------------------------
878 /**
879  * Stop profile data session.
880  *
881  * @note
882  * The process exits, if an invalid profile object is given
883  */
884 //--------------------------------------------------------------------------------------------------
886 (
887  le_mdc_ProfileRef_t profileRef,
888  ///< [IN] Stop data session for this profile object
889  le_mdc_SessionHandlerFunc_t handlerPtr,
890  ///< [IN] Handler for stop data session result
891  void* contextPtr
892  ///< [IN]
893 );
894 
895 //--------------------------------------------------------------------------------------------------
896 /**
897  * Reject MT-PDP profile data session.
898  *
899  * @return
900  * - LE_OK on success
901  * - LE_BAD_PARAMETER if the input parameter is not valid
902  * - LE_UNSUPPORTED if not supported by the target
903  * - LE_FAULT for other failures
904  *
905  * @note
906  * The process exits, if an invalid profile object is given
907  *
908  * @warning The MT-PDP context activation feature is not supported on all platforms. Please refer to
909  * @ref MT-PDP_context section for full details.
910  */
911 //--------------------------------------------------------------------------------------------------
913 (
914  le_mdc_ProfileRef_t profileRef
915  ///< [IN] Reject MT-PDP data session for this profile object
916 );
917 
918 //--------------------------------------------------------------------------------------------------
919 /**
920  * Get the current data session state.
921  *
922  * @return
923  * - LE_OK on success
924  * - LE_BAD_PARAMETER if an input parameter is not valid
925  * - LE_FAULT on failure
926  *
927  * @note
928  * The process exits, if an invalid profile object is given
929  */
930 //--------------------------------------------------------------------------------------------------
932 (
933  le_mdc_ProfileRef_t profileRef,
934  ///< [IN] Query this profile object
935  le_mdc_ConState_t* connectionStatePtr
936  ///< [OUT] The data session state
937 );
938 
939 //--------------------------------------------------------------------------------------------------
940 /**
941  * Get the network interface name, if the data session is connected.
942  *
943  * @return
944  * - LE_OK on success
945  * - LE_OVERFLOW if the interface name would not fit in interfaceNameStr
946  * - LE_FAULT for all other errors
947  *
948  * @note
949  * The process exits, if an invalid profile object is given
950  */
951 //--------------------------------------------------------------------------------------------------
953 (
954  le_mdc_ProfileRef_t profileRef,
955  ///< [IN] Query this profile object
956  char* interfaceName,
957  ///< [OUT] The name of the network interface
958  size_t interfaceNameSize
959  ///< [IN]
960 );
961 
962 //--------------------------------------------------------------------------------------------------
963 /**
964  * Get the IPv4 address for the given profile, if the data session is connected and has an IPv4
965  * address.
966  *
967  * @return
968  * - LE_OK on success
969  * - LE_OVERFLOW if the IP address would not fit in ipAddrStr
970  * - LE_FAULT for all other errors
971  *
972  * @note
973  * The process exits, if an invalid profile object is given
974  */
975 //--------------------------------------------------------------------------------------------------
977 (
978  le_mdc_ProfileRef_t profileRef,
979  ///< [IN] Query this profile object
980  char* ipAddr,
981  ///< [OUT] The IP address in dotted format
982  size_t ipAddrSize
983  ///< [IN]
984 );
985 
986 //--------------------------------------------------------------------------------------------------
987 /**
988  * Get the gateway IPv4 address for the given profile, if the data session is connected and has an
989  * IPv4 address.
990  *
991  * @return
992  * - LE_OK on success
993  * - LE_OVERFLOW if the IP address would not fit in gatewayAddrStr
994  * - LE_FAULT for all other errors
995  *
996  * @note
997  * The process exits, if an invalid profile object is given
998  */
999 //--------------------------------------------------------------------------------------------------
1001 (
1002  le_mdc_ProfileRef_t profileRef,
1003  ///< [IN] Query this profile object
1004  char* gatewayAddr,
1005  ///< [OUT] The gateway IP address in dotted format
1006  size_t gatewayAddrSize
1007  ///< [IN]
1008 );
1009 
1010 //--------------------------------------------------------------------------------------------------
1011 /**
1012  * Get the primary/secondary DNS v4 addresses for the given profile, if the data session is
1013  * connected and has an IPv4 address.
1014  *
1015  * @return
1016  * - LE_OK on success
1017  * - LE_OVERFLOW if the IP address would not fit in buffer
1018  * - LE_FAULT for all other errors
1019  *
1020  * @note
1021  * - If only one DNS address is available, then it will be returned, and an empty string will
1022  * be returned for the unavailable address
1023  * - The process exits, if an invalid profile object is given
1024  */
1025 //--------------------------------------------------------------------------------------------------
1027 (
1028  le_mdc_ProfileRef_t profileRef,
1029  ///< [IN] Query this profile object
1030  char* dns1AddrStr,
1031  ///< [OUT] The primary DNS IP address in dotted format
1032  size_t dns1AddrStrSize,
1033  ///< [IN]
1034  char* dns2AddrStr,
1035  ///< [OUT] The secondary DNS IP address in dotted format
1036  size_t dns2AddrStrSize
1037  ///< [IN]
1038 );
1039 
1040 //--------------------------------------------------------------------------------------------------
1041 /**
1042  * Get the IPv6 address for the given profile, if the data session is connected and has an IPv6
1043  * address.
1044  *
1045  * @return
1046  * - LE_OK on success
1047  * - LE_OVERFLOW if the IP address would not fit in ipAddrStr
1048  * - LE_FAULT for all other errors
1049  *
1050  * @note
1051  * The process exits, if an invalid profile object is given
1052  */
1053 //--------------------------------------------------------------------------------------------------
1055 (
1056  le_mdc_ProfileRef_t profileRef,
1057  ///< [IN] Query this profile object
1058  char* ipAddr,
1059  ///< [OUT] The IP address in dotted format
1060  size_t ipAddrSize
1061  ///< [IN]
1062 );
1063 
1064 //--------------------------------------------------------------------------------------------------
1065 /**
1066  * Get the gateway IPv6 address for the given profile, if the data session is connected and has an
1067  * IPv6 address.
1068  *
1069  * @return
1070  * - LE_OK on success
1071  * - LE_OVERFLOW if the IP address would not fit in gatewayAddrStr
1072  * - LE_FAULT for all other errors
1073  *
1074  * @note
1075  * The process exits, if an invalid profile object is given
1076  */
1077 //--------------------------------------------------------------------------------------------------
1079 (
1080  le_mdc_ProfileRef_t profileRef,
1081  ///< [IN] Query this profile object
1082  char* gatewayAddr,
1083  ///< [OUT] The gateway IP address in dotted format
1084  size_t gatewayAddrSize
1085  ///< [IN]
1086 );
1087 
1088 //--------------------------------------------------------------------------------------------------
1089 /**
1090  * Get the primary/secondary DNS v6 addresses, if the data session is connected and has an IPv6
1091  * address.
1092  *
1093  * @return
1094  * - LE_OK on success
1095  * - LE_OVERFLOW if the IP address can't fit in buffer
1096  * - LE_FAULT for all other errors
1097  *
1098  * @note
1099  * - If only one DNS address is available, it will be returned, and an empty string will
1100  * be returned for the unavailable address.
1101  * - The process exits, if an invalid profile object is given
1102  */
1103 //--------------------------------------------------------------------------------------------------
1105 (
1106  le_mdc_ProfileRef_t profileRef,
1107  ///< [IN] Query this profile object
1108  char* dns1AddrStr,
1109  ///< [OUT] The primary DNS IP address in dotted format
1110  size_t dns1AddrStrSize,
1111  ///< [IN]
1112  char* dns2AddrStr,
1113  ///< [OUT] The secondary DNS IP address in dotted format
1114  size_t dns2AddrStrSize
1115  ///< [IN]
1116 );
1117 
1118 //--------------------------------------------------------------------------------------------------
1119 /**
1120  * Allow the caller to know if the given profile is actually supporting IPv4, if the data session
1121  * is connected.
1122  *
1123  * @return TRUE if PDP type is IPv4, FALSE otherwise.
1124  *
1125  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1126  * function will not return.
1127  */
1128 //--------------------------------------------------------------------------------------------------
1129 bool le_mdc_IsIPv4
1130 (
1131  le_mdc_ProfileRef_t profileRef
1132  ///< [IN] Query this profile object
1133 );
1134 
1135 //--------------------------------------------------------------------------------------------------
1136 /**
1137  * Allow the caller to know if the given profile is actually supporting IPv6, if the data session
1138  * is connected.
1139  *
1140  * @return TRUE if PDP type is IPv6, FALSE otherwise.
1141  *
1142  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1143  * function will not return.
1144  */
1145 //--------------------------------------------------------------------------------------------------
1146 bool le_mdc_IsIPv6
1147 (
1148  le_mdc_ProfileRef_t profileRef
1149  ///< [IN] Query this profile object
1150 );
1151 
1152 //--------------------------------------------------------------------------------------------------
1153 /**
1154  * Get the Data Bearer Technology for the given profile, if the data session is connected.
1155  *
1156  * @return
1157  * - LE_OK on success
1158  * - LE_FAULT for all other errors
1159  *
1160  * @note
1161  * The process exits, if an invalid profile object is given
1162  */
1163 //--------------------------------------------------------------------------------------------------
1165 (
1166  le_mdc_ProfileRef_t profileRef,
1167  ///< [IN] Query this profile object
1168  le_mdc_DataBearerTechnology_t* downlinkDataBearerTechPtrPtr,
1169  ///< [OUT] downlink data bearer technology
1170  le_mdc_DataBearerTechnology_t* uplinkDataBearerTechPtrPtr
1171  ///< [OUT] uplink data bearer technology
1172 );
1173 
1174 //--------------------------------------------------------------------------------------------------
1175 /**
1176  * Get number of bytes received/transmitted without error since the last reset.
1177  *
1178  * @return
1179  * - LE_OK on success
1180  * - LE_FAULT for all other errors
1181  *
1182  * @note
1183  * - The process exits, if an invalid pointer is given
1184  */
1185 //--------------------------------------------------------------------------------------------------
1187 (
1188  uint64_t* rxBytesPtr,
1189  ///< [OUT] bytes amount received since the last counter reset
1190  uint64_t* txBytesPtr
1191  ///< [OUT] bytes amount transmitted since the last counter reset
1192 );
1193 
1194 //--------------------------------------------------------------------------------------------------
1195 /**
1196  * Reset received/transmitted data flow statistics
1197  *
1198  * @return
1199  * - LE_OK on success
1200  * - LE_FAULT for all other errors
1201  */
1202 //--------------------------------------------------------------------------------------------------
1204 (
1205  void
1206 );
1207 
1208 //--------------------------------------------------------------------------------------------------
1209 /**
1210  * Stop collecting received/transmitted data flow statistics
1211  *
1212  * @return
1213  * - LE_OK on success
1214  * - LE_FAULT for all other errors
1215  */
1216 //--------------------------------------------------------------------------------------------------
1218 (
1219  void
1220 );
1221 
1222 //--------------------------------------------------------------------------------------------------
1223 /**
1224  * Start collecting received/transmitted data flow statistics
1225  *
1226  * @return
1227  * - LE_OK on success
1228  * - LE_FAULT for all other errors
1229  */
1230 //--------------------------------------------------------------------------------------------------
1232 (
1233  void
1234 );
1235 
1236 //--------------------------------------------------------------------------------------------------
1237 /**
1238  * Set the Packet Data Protocol (PDP) for the given profile.
1239  *
1240  * @return
1241  * - LE_OK on success
1242  * - LE_BAD_PARAMETER if the PDP is not supported
1243  * - LE_FAULT if the data session is currently connected for the given profile
1244  *
1245  * @note
1246  * The process exits, if an invalid profile object is given
1247  */
1248 //--------------------------------------------------------------------------------------------------
1250 (
1251  le_mdc_ProfileRef_t profileRef,
1252  ///< [IN] Query this profile object
1253  le_mdc_Pdp_t pdp
1254  ///< [IN] The Packet Data Protocol
1255 );
1256 
1257 //--------------------------------------------------------------------------------------------------
1258 /**
1259  * Get the Packet Data Protocol (PDP) for the given profile.
1260  *
1261  * @return
1262  * - packet data protocol value
1263  *
1264  * @note
1265  * The process exits, if an invalid profile object is given
1266  */
1267 //--------------------------------------------------------------------------------------------------
1269 (
1270  le_mdc_ProfileRef_t profileRef
1271  ///< [IN] Query this profile object
1272 );
1273 
1274 //--------------------------------------------------------------------------------------------------
1275 /**
1276  * Set the Access Point Name (APN) for the given profile.
1277  *
1278  * The APN must be an ASCII string.
1279  *
1280  * @return
1281  * - LE_OK on success
1282  * - LE_BAD_PARAMETER if an input parameter is not valid
1283  * - LE_FAULT if the data session is currently connected for the given profile
1284  *
1285  * @note If APN is too long (max APN_NAME_MAX_LEN digits), it is a fatal error, the
1286  * function will not return.
1287  *
1288  * @warning The maximum APN length might be limited by the platform.
1289  * Please refer to the platform documentation @ref platformConstraintsMdc.
1290  *
1291  * @note
1292  * The process exits, if an invalid profile object is given
1293  */
1294 //--------------------------------------------------------------------------------------------------
1296 (
1297  le_mdc_ProfileRef_t profileRef,
1298  ///< [IN] Query this profile object
1299  const char* LE_NONNULL apnStr
1300  ///< [IN] The Access Point Name
1301 );
1302 
1303 //--------------------------------------------------------------------------------------------------
1304 /**
1305  * Set the Access Point Name (APN) for the given profile according to the SIM identification
1306  * number (ICCID). If no APN is found using the ICCID, fall back on the home network (MCC/MNC)
1307  * to determine the default APN.
1308  *
1309  * @return
1310  * - LE_OK on success
1311  * - LE_BAD_PARAMETER if an input parameter is not valid
1312  * - LE_FAULT for all other errors
1313  *
1314  * @note
1315  * The process exits if an invalid profile object is given
1316  */
1317 //--------------------------------------------------------------------------------------------------
1319 (
1320  le_mdc_ProfileRef_t profileRef
1321  ///< [IN] Query this profile object
1322 );
1323 
1324 //--------------------------------------------------------------------------------------------------
1325 /**
1326  * Get the Access Point Name (APN) for the given profile.
1327  *
1328  * @return
1329  * - LE_OK on success
1330  * - LE_BAD_PARAMETER if an input parameter is not valid
1331  * - LE_OVERFLOW if the APN is is too long
1332  * - LE_FAULT on failed
1333  *
1334  * @note
1335  * The process exits, if an invalid profile object is given
1336  */
1337 //--------------------------------------------------------------------------------------------------
1339 (
1340  le_mdc_ProfileRef_t profileRef,
1341  ///< [IN] Query this profile object
1342  char* apnStr,
1343  ///< [OUT] The Access Point Name
1344  size_t apnStrSize
1345  ///< [IN]
1346 );
1347 
1348 //--------------------------------------------------------------------------------------------------
1349 /**
1350  * Set authentication property
1351  *
1352  * @return
1353  * - LE_OK on success
1354  *
1355  * @note
1356  * - The process exits, if userName or password are NULL when type is not PA_MDC_AUTH_NONE
1357  * - The process exits, if an invalid profile object is given
1358  * @note If userName is too long (max USER_NAME_MAX_LEN digits), it is a fatal error, the
1359  * function will not return.
1360  * @note If password is too long (max PASSWORD_NAME_MAX_LEN digits), it is a fatal error, the
1361  * function will not return.
1362  * @note Both PAP and CHAP authentication can be set for 3GPP network: in this case, the device
1363  * decides which authentication procedure is performed. For example, the device can have a
1364  * policy to select the most secure authentication mechanism.
1365  *
1366  */
1367 //--------------------------------------------------------------------------------------------------
1369 (
1370  le_mdc_ProfileRef_t profileRef,
1371  ///< [IN] Query this profile object
1372  le_mdc_Auth_t type,
1373  ///< [IN] Authentication type
1374  const char* LE_NONNULL userName,
1375  ///< [IN] UserName used by authentication
1376  const char* LE_NONNULL password
1377  ///< [IN] Password used by authentication
1378 );
1379 
1380 //--------------------------------------------------------------------------------------------------
1381 /**
1382  * Get authentication property
1383  *
1384  * @return
1385  * - LE_OK on success
1386  * - LE_BAD_PARAMETER if an input parameter is not valid
1387  * - LE_OVERFLOW userName or password are too small
1388  * - LE_FAULT on failed
1389  *
1390  * @note
1391  * The process exits, if an invalid profile object is given
1392  */
1393 //--------------------------------------------------------------------------------------------------
1395 (
1396  le_mdc_ProfileRef_t profileRef,
1397  ///< [IN] Query this profile object
1398  le_mdc_Auth_t* typePtr,
1399  ///< [OUT] Authentication type
1400  char* userName,
1401  ///< [OUT] UserName used by authentication
1402  size_t userNameSize,
1403  ///< [IN]
1404  char* password,
1405  ///< [OUT] Password used by authentication
1406  size_t passwordSize
1407  ///< [IN]
1408 );
1409 
1410 //--------------------------------------------------------------------------------------------------
1411 /**
1412  * Get the number of profiles on the modem.
1413  *
1414  * @return
1415  * - number of profiles existing on modem
1416  */
1417 //--------------------------------------------------------------------------------------------------
1418 uint32_t le_mdc_NumProfiles
1419 (
1420  void
1421 );
1422 
1423 //--------------------------------------------------------------------------------------------------
1424 /**
1425  * Get a profile selected by its APN
1426  *
1427  * @return
1428  * - LE_OK on success
1429  * - LE_BAD_PARAMETER if an input parameter is not valid
1430  * - LE_NOT_FOUND if the requested APN is not found
1431  */
1432 //--------------------------------------------------------------------------------------------------
1434 (
1435  const char* LE_NONNULL apnStr,
1436  ///< [IN] The Access Point Name
1437  le_mdc_ProfileRef_t* profileRefPtr
1438  ///< [OUT] profile reference
1439 );
1440 
1441 //--------------------------------------------------------------------------------------------------
1442 /**
1443  * Called to get the disconnection reason.
1444  *
1445  * @return The disconnection reason.
1446  *
1447  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1448  * function will not return.
1449  *
1450  * @deprecated This function is deprecated, le_mdc_GetDisconnectionReasonExt should be used for the
1451  * new code.
1452  */
1453 //--------------------------------------------------------------------------------------------------
1455 (
1456  le_mdc_ProfileRef_t profileRef
1457  ///< [IN] profile reference
1458 );
1459 
1460 //--------------------------------------------------------------------------------------------------
1461 /**
1462  * Called to get the platform specific disconnection code.
1463  *
1464  * Refer to @ref platformConstraintsSpecificErrorCodes for platform specific
1465  * disconnection code description.
1466  *
1467  * @return The platform specific disconnection code.
1468  *
1469  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1470  * function will not return.
1471  *
1472  * @deprecated This function is deprecated, le_mdc_GetPlatformSpecificDisconnectionCodeExt should
1473  * be used for the new code.
1474  */
1475 //--------------------------------------------------------------------------------------------------
1477 (
1478  le_mdc_ProfileRef_t profileRef
1479  ///< [IN] profile reference
1480 );
1481 
1482 //--------------------------------------------------------------------------------------------------
1483 /**
1484  * Called to get the platform specific connection failure reason.
1485  *
1486  * Refer to @ref platformConstraintsSpecificErrorCodes for platform specific
1487  * connection failure types and code descriptions.
1488  *
1489  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1490  * function will not return.
1491  *
1492  * @deprecated This function is deprecated, le_mdc_GetPlatformSpecificFailureConnectionReasonExt
1493  * should be used for new code.
1494  */
1495 //--------------------------------------------------------------------------------------------------
1497 (
1498  le_mdc_ProfileRef_t profileRef,
1499  ///< [IN] profile reference
1500  int32_t* failureTypePtr,
1501  ///< [OUT] platform specific failure type
1502  int32_t* failureCodePtr
1503  ///< [OUT] platform specific failure code
1504 );
1505 
1506 //--------------------------------------------------------------------------------------------------
1507 /**
1508  * Called to get the disconnection reason.
1509  *
1510  * @return The disconnection reason.
1511  *
1512  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1513  * function will not return.
1514  * @note For IPv4v6 mode, pdpType specifies which session's disconnect reason to get(IPv4 or IPv6
1515  * session). For IPv4 and IPv6 mode, pdpType is ignored because there is only one session for
1516  * IPv4 and IPv6 mode.
1517  */
1518 //--------------------------------------------------------------------------------------------------
1520 (
1521  le_mdc_ProfileRef_t profileRef,
1522  ///< [IN] profile reference
1523  le_mdc_Pdp_t pdpType
1524  ///< [IN] pdp type of session
1525 );
1526 
1527 //--------------------------------------------------------------------------------------------------
1528 /**
1529  * Called to get the platform specific disconnection code.
1530  *
1531  * Refer to @ref platformConstraintsSpecificErrorCodes for platform specific
1532  * disconnection code description.
1533  *
1534  * @return The platform specific disconnection code.
1535  *
1536  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1537  * function will not return.
1538  * @note For IPv4v6 mode, pdpType specifies which session's disconnect reason to get(IPv4 or IPv6
1539  * session). For IPv4 and IPv6 mode, pdpType is ignored because there is only one session for
1540  * IPv4 and IPv6 mode.
1541  */
1542 //--------------------------------------------------------------------------------------------------
1544 (
1545  le_mdc_ProfileRef_t profileRef,
1546  ///< [IN] profile reference
1547  le_mdc_Pdp_t pdpType
1548  ///< [IN] pdp type of session
1549 );
1550 
1551 //--------------------------------------------------------------------------------------------------
1552 /**
1553  * Called to get the platform specific connection failure reason.
1554  *
1555  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1556  * function will not return.
1557  * @note For IPv4v6 mode, pdpType specifies which session's disconnect reason to get(IPv4 or IPv6
1558  * session). For IPv4 and IPv6 mode, pdpType is ignored because there is only one session for
1559  * IPv4 and IPv6 mode.
1560  */
1561 //--------------------------------------------------------------------------------------------------
1563 (
1564  le_mdc_ProfileRef_t profileRef,
1565  ///< [IN] profile reference
1566  le_mdc_Pdp_t pdpType,
1567  ///< [IN] pdp type of session
1568  int32_t* failureTypePtr,
1569  ///< [OUT] platform specific failure type
1570  int32_t* failureCodePtr
1571  ///< [OUT] platform specific failure code
1572 );
1573 
1574 //--------------------------------------------------------------------------------------------------
1575 /**
1576  * Map a profile on a network interface
1577  *
1578  * * @return
1579  * - LE_OK on success
1580  * - LE_UNSUPPORTED if not supported by the target
1581  * - LE_FAULT for all other errors
1582  *
1583  */
1584 //--------------------------------------------------------------------------------------------------
1586 (
1587  le_mdc_ProfileRef_t profileRef,
1588  ///< [IN] Profile reference
1589  const char* LE_NONNULL interfaceName
1590  ///< [IN] Network interface name
1591 );
1592 
1593 //--------------------------------------------------------------------------------------------------
1594 /**
1595  * Get the list of available profiles
1596  *
1597  * @return
1598  * - list of available profiles
1599  * - LE_OK if the retrieval is successful; otherwise, some error code
1600  */
1601 //--------------------------------------------------------------------------------------------------
1603 (
1604  le_mdc_ProfileInfo_t* profileListPtr,
1605  ///< [OUT] list of available profiles
1606  size_t* profileListSizePtr
1607  ///< [INOUT]
1608 );
1609 
1610 #endif // LE_MDC_INTERFACE_H_INCLUDE_GUARD
le_result_t le_mdc_GetSessionState(le_mdc_ProfileRef_t profileRef, le_mdc_ConState_t *connectionStatePtr)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:607
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:567
le_mdc_SessionStateHandlerRef_t le_mdc_AddSessionStateHandler(le_mdc_ProfileRef_t profileRef, le_mdc_SessionStateHandlerFunc_t handlerPtr, void *contextPtr)
Suspending data session.
Definition: le_mdc_interface.h:538
Data session is disconnected.
Definition: le_mdc_interface.h:532
le_mdc_DataBearerTechnology_t
Definition: le_mdc_interface.h:418
le_mdc_Pdp_t le_mdc_GetPDP(le_mdc_ProfileRef_t profileRef)
void le_mdc_StartSessionAsync(le_mdc_ProfileRef_t profileRef, le_mdc_SessionHandlerFunc_t handlerPtr, void *contextPtr)
HDR REVB MPA.
Definition: le_mdc_interface.h:474
Dual Cell - HSPA+.
Definition: le_mdc_interface.h:434
le_result_t le_mdc_GetDataBearerTechnology(le_mdc_ProfileRef_t profileRef, le_mdc_DataBearerTechnology_t *downlinkDataBearerTechPtrPtr, le_mdc_DataBearerTechnology_t *uplinkDataBearerTechPtrPtr)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:595
le_result_t le_mdc_SetAPN(le_mdc_ProfileRef_t profileRef, const char *LE_NONNULL apnStr)
Data session is connected.
Definition: le_mdc_interface.h:536
Dual Cell - HSUPA.
Definition: le_mdc_interface.h:440
struct le_mdc_SessionStateHandler * le_mdc_SessionStateHandlerRef_t
Definition: le_mdc_interface.h:654
IPv4 and IPv6.
Definition: le_mdc_interface.h:505
le_result_t
Definition: le_basics.h:35
bool le_mdc_IsIPv4(le_mdc_ProfileRef_t profileRef)
IPv4.
Definition: le_mdc_interface.h:501
64 QAM
Definition: le_mdc_interface.h:484
Incoming data session (MT-PDP context request)
Definition: le_mdc_interface.h:540
cf. 3GPP 24.008 Annex I2
Definition: le_mdc_interface.h:639
Platform specific code.
Definition: le_mdc_interface.h:641
LTE TDD.
Definition: le_mdc_interface.h:448
le_mdc_Pdp_t
Definition: le_mdc_interface.h:497
le_mdc_DisconnectionReason_t
Definition: le_mdc_interface.h:551
cf. 3GPP 24.008 Annex I2
Definition: le_mdc_interface.h:633
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:589
le_result_t le_mdc_GetIPv4GatewayAddress(le_mdc_ProfileRef_t profileRef, char *gatewayAddr, size_t gatewayAddrSize)
HSUPA.
Definition: le_mdc_interface.h:438
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:621
le_result_t le_mdc_StopSession(le_mdc_ProfileRef_t profileRef)
le_result_t le_mdc_GetAPN(le_mdc_ProfileRef_t profileRef, char *apnStr, size_t apnStrSize)
void le_mdc_SetServerDisconnectHandler(le_mdc_DisconnectHandler_t disconnectHandler, void *contextPtr)
le_result_t le_mdc_GetIPv4DNSAddresses(le_mdc_ProfileRef_t profileRef, char *dns1AddrStr, size_t dns1AddrStrSize, char *dns2AddrStr, size_t dns2AddrStrSize)
le_result_t le_mdc_GetIPv6Address(le_mdc_ProfileRef_t profileRef, char *ipAddr, size_t ipAddrSize)
Undefined reason.
Definition: le_mdc_interface.h:643
cf. 3GPP 24.008 Annex I2
Definition: le_mdc_interface.h:637
int32_t le_mdc_GetPlatformSpecificDisconnectionCodeExt(le_mdc_ProfileRef_t profileRef, le_mdc_Pdp_t pdpType)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:561
void le_mdc_ConnectService(void)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:557
Authenticating data session.
Definition: le_mdc_interface.h:534
no authentication
Definition: le_mdc_interface.h:518
struct le_mdc_Profile * le_mdc_ProfileRef_t
Definition: le_mdc_interface.h:410
void le_mdc_StopSessionAsync(le_mdc_ProfileRef_t profileRef, le_mdc_SessionHandlerFunc_t handlerPtr, void *contextPtr)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:585
HDR REVB EMPA.
Definition: le_mdc_interface.h:478
HSPA+.
Definition: le_mdc_interface.h:432
S2B.
Definition: le_mdc_interface.h:486
cf. 3GPP 24.008 Annex I2
Definition: le_mdc_interface.h:627
le_result_t le_mdc_GetInterfaceName(le_mdc_ProfileRef_t profileRef, char *interfaceName, size_t interfaceNameSize)
le_result_t le_mdc_GetProfileList(le_mdc_ProfileInfo_t *profileListPtr, size_t *profileListSizePtr)
le_result_t le_mdc_SetPDP(le_mdc_ProfileRef_t profileRef, le_mdc_Pdp_t pdp)
CHAP protocol.
Definition: le_mdc_interface.h:520
WCDMA (UMTS)
Definition: le_mdc_interface.h:428
void(* le_mdc_MtPdpSessionStateHandlerFunc_t)(le_mdc_ConState_t ConnectionState, void *contextPtr)
Definition: le_mdc_interface.h:700
HDR REVA DPA.
Definition: le_mdc_interface.h:468
HSPA.
Definition: le_mdc_interface.h:430
bool le_mdc_IsIPv6(le_mdc_ProfileRef_t profileRef)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:611
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:581
IS95 1X.
Definition: le_mdc_interface.h:464
Enhanced GPRS (EDGE)
Definition: le_mdc_interface.h:426
IPv6.
Definition: le_mdc_interface.h:503
Unknown.
Definition: le_mdc_interface.h:499
LTE FDD.
Definition: le_mdc_interface.h:446
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:605
Unknown.
Definition: le_mdc_interface.h:420
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:591
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:593
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:609
Dual Cell - HSPA.
Definition: le_mdc_interface.h:442
le_result_t le_mdc_GetBytesCounters(uint64_t *rxBytesPtr, uint64_t *txBytesPtr)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:577
cf. 3GPP 24.008 Annex I2
Definition: le_mdc_interface.h:631
CDMA2000 HRPD (1xEV-DO)
Definition: le_mdc_interface.h:458
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:619
le_mdc_DisconnectionReason_t le_mdc_GetDisconnectionReason(le_mdc_ProfileRef_t profileRef)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:599
cf. 3GPP 24.008 Annex I2
Definition: le_mdc_interface.h:629
cf. 3GPP 24.008 Annex I2
Definition: le_mdc_interface.h:625
void(* le_mdc_DisconnectHandler_t)(void *)
Definition: le_mdc_interface.h:208
le_result_t le_mdc_GetAuthentication(le_mdc_ProfileRef_t profileRef, le_mdc_Auth_t *typePtr, char *userName, size_t userNameSize, char *password, size_t passwordSize)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:575
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:559
cf. 3GPP 24.008 Annex I2
Definition: le_mdc_interface.h:635
void le_mdc_GetPlatformSpecificFailureConnectionReason(le_mdc_ProfileRef_t profileRef, int32_t *failureTypePtr, int32_t *failureCodePtr)
void le_mdc_RemoveSessionStateHandler(le_mdc_SessionStateHandlerRef_t handlerRef)
void le_mdc_RemoveMtPdpSessionStateHandler(le_mdc_MtPdpSessionStateHandlerRef_t handlerRef)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:573
Definition: le_mdc_interface.h:670
le_result_t le_mdc_TryConnectService(void)
void le_mdc_GetPlatformSpecificFailureConnectionReasonExt(le_mdc_ProfileRef_t profileRef, le_mdc_Pdp_t pdpType, int32_t *failureTypePtr, int32_t *failureCodePtr)
HDR REVB MMPA.
Definition: le_mdc_interface.h:480
le_mdc_ProfileRef_t le_mdc_GetProfile(uint32_t index)
Modem has no service.
Definition: le_mdc_interface.h:553
int32_t le_mdc_GetPlatformSpecificDisconnectionCode(le_mdc_ProfileRef_t profileRef)
LTE CA DL.
Definition: le_mdc_interface.h:450
HDR REVA EMPA.
Definition: le_mdc_interface.h:476
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:555
HDR EVDO FMC.
Definition: le_mdc_interface.h:482
CDMA2000 EHRPD.
Definition: le_mdc_interface.h:462
le_result_t le_mdc_StartSession(le_mdc_ProfileRef_t profileRef)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:617
le_result_t le_mdc_ResetBytesCounter(void)
void le_mdc_DisconnectService(void)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:597
struct le_mdc_MtPdpSessionStateHandler * le_mdc_MtPdpSessionStateHandlerRef_t
Definition: le_mdc_interface.h:662
le_result_t le_mdc_GetIPv4Address(le_mdc_ProfileRef_t profileRef, char *ipAddr, size_t ipAddrSize)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:603
HDR REVB DPA.
Definition: le_mdc_interface.h:470
HSDPA.
Definition: le_mdc_interface.h:436
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:615
le_result_t le_mdc_StartBytesCounter(void)
le_mdc_MtPdpSessionStateHandlerRef_t le_mdc_AddMtPdpSessionStateHandler(le_mdc_SessionStateHandlerFunc_t handlerPtr, void *contextPtr)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:563
le_result_t le_mdc_GetIPv6GatewayAddress(le_mdc_ProfileRef_t profileRef, char *gatewayAddr, size_t gatewayAddrSize)
le_mdc_ConState_t
Definition: le_mdc_interface.h:530
LTE.
Definition: le_mdc_interface.h:444
le_mdc_Auth_t
Definition: le_mdc_interface.h:516
le_result_t le_mdc_SetAuthentication(le_mdc_ProfileRef_t profileRef, le_mdc_Auth_t type, const char *LE_NONNULL userName, const char *LE_NONNULL password)
GPRS.
Definition: le_mdc_interface.h:424
le_result_t le_mdc_GetProfileFromApn(const char *LE_NONNULL apnStr, le_mdc_ProfileRef_t *profileRefPtr)
HDR REVA MPA.
Definition: le_mdc_interface.h:472
PAP protocol.
Definition: le_mdc_interface.h:519
uint32_t le_mdc_GetProfileIndex(le_mdc_ProfileRef_t profileRef)
uint32_t le_mdc_NumProfiles(void)
le_result_t le_mdc_SetDefaultAPN(le_mdc_ProfileRef_t profileRef)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:565
LTE CA UL.
Definition: le_mdc_interface.h:452
le_result_t le_mdc_StopBytesCounter(void)
le_result_t le_mdc_RejectMtPdpSession(le_mdc_ProfileRef_t profileRef)
void(* le_mdc_SessionHandlerFunc_t)(le_mdc_ProfileRef_t profileRef, le_result_t result, void *contextPtr)
Definition: le_mdc_interface.h:714
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:613
CDMA2000 HRPD (1xEV-DO RevA)
Definition: le_mdc_interface.h:460
void(* le_mdc_SessionStateHandlerFunc_t)(le_mdc_ProfileRef_t profileRef, le_mdc_ConState_t ConnectionState, void *contextPtr)
Definition: le_mdc_interface.h:685
GSM.
Definition: le_mdc_interface.h:422
HDR REV0 DPA.
Definition: le_mdc_interface.h:466
TD-SCDMA.
Definition: le_mdc_interface.h:454
le_result_t le_mdc_MapProfileOnNetworkInterface(le_mdc_ProfileRef_t profileRef, const char *LE_NONNULL interfaceName)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:587
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:601
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:583
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:579
cf. 3GPP 24.008 Annex I2
Definition: le_mdc_interface.h:623
CDMA2000 1X.
Definition: le_mdc_interface.h:456
le_result_t le_mdc_GetIPv6DNSAddresses(le_mdc_ProfileRef_t profileRef, char *dns1AddrStr, size_t dns1AddrStrSize, char *dns2AddrStr, size_t dns2AddrStrSize)
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:571
cf. 3GPP 24.008 Annex I1
Definition: le_mdc_interface.h:569
le_mdc_DisconnectionReason_t le_mdc_GetDisconnectionReasonExt(le_mdc_ProfileRef_t profileRef, le_mdc_Pdp_t pdpType)