#include "legato.h"
#include "le_mdc_common.h"
Go to the source code of this file.
Typedefs | |
typedef void(* | le_mdc_DisconnectHandler_t) (void *) |
Functions | |
void | le_mdc_ConnectService (void) |
le_result_t | le_mdc_TryConnectService (void) |
LE_FULL_API void | le_mdc_SetServerDisconnectHandler (le_mdc_DisconnectHandler_t disconnectHandler, void *contextPtr) |
void | le_mdc_DisconnectService (void) |
le_mdc_SessionStateHandlerRef_t | le_mdc_AddSessionStateHandler (le_mdc_ProfileRef_t profileRef, le_mdc_SessionStateHandlerFunc_t handlerPtr, void *contextPtr) |
void | le_mdc_RemoveSessionStateHandler (le_mdc_SessionStateHandlerRef_t handlerRef) |
le_mdc_MtPdpSessionStateHandlerRef_t | le_mdc_AddMtPdpSessionStateHandler (le_mdc_SessionStateHandlerFunc_t handlerPtr, void *contextPtr) |
void | le_mdc_RemoveMtPdpSessionStateHandler (le_mdc_MtPdpSessionStateHandlerRef_t handlerRef) |
le_mdc_ProfileRef_t | le_mdc_GetProfile (uint32_t index) |
uint32_t | le_mdc_GetProfileIndex (le_mdc_ProfileRef_t profileRef) |
le_result_t | le_mdc_GetCidList (uint8_t *cidPtr, size_t *cidSizePtr) |
le_result_t | le_mdc_StartSession (le_mdc_ProfileRef_t profileRef) |
void | le_mdc_StartSessionAsync (le_mdc_ProfileRef_t profileRef, le_mdc_SessionHandlerFunc_t handlerPtr, void *contextPtr) |
le_result_t | le_mdc_StopSession (le_mdc_ProfileRef_t profileRef) |
void | le_mdc_StopSessionAsync (le_mdc_ProfileRef_t profileRef, le_mdc_SessionHandlerFunc_t handlerPtr, void *contextPtr) |
le_result_t | le_mdc_RejectMtPdpSession (le_mdc_ProfileRef_t profileRef) |
le_result_t | le_mdc_GetSessionState (le_mdc_ProfileRef_t profileRef, le_mdc_ConState_t *connectionStatePtr) |
le_result_t | le_mdc_GetInterfaceName (le_mdc_ProfileRef_t profileRef, char *interfaceName, size_t interfaceNameSize) |
le_result_t | le_mdc_GetIPv4Address (le_mdc_ProfileRef_t profileRef, char *ipAddr, size_t ipAddrSize) |
le_result_t | le_mdc_GetIPv4GatewayAddress (le_mdc_ProfileRef_t profileRef, char *gatewayAddr, size_t gatewayAddrSize) |
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) |
le_result_t | le_mdc_GetIPv6GatewayAddress (le_mdc_ProfileRef_t profileRef, char *gatewayAddr, size_t gatewayAddrSize) |
le_result_t | le_mdc_GetIPv6DNSAddresses (le_mdc_ProfileRef_t profileRef, char *dns1AddrStr, size_t dns1AddrStrSize, char *dns2AddrStr, size_t dns2AddrStrSize) |
bool | le_mdc_IsIPv4 (le_mdc_ProfileRef_t profileRef) |
bool | le_mdc_IsIPv6 (le_mdc_ProfileRef_t profileRef) |
le_result_t | le_mdc_GetDataBearerTechnology (le_mdc_ProfileRef_t profileRef, le_mdc_DataBearerTechnology_t *downlinkDataBearerTechPtrPtr, le_mdc_DataBearerTechnology_t *uplinkDataBearerTechPtrPtr) |
le_result_t | le_mdc_GetBytesCounters (uint64_t *rxBytesPtr, uint64_t *txBytesPtr) |
le_result_t | le_mdc_ResetBytesCounter (void) |
le_result_t | le_mdc_StopBytesCounter (void) |
le_result_t | le_mdc_StartBytesCounter (void) |
le_result_t | le_mdc_SetPDP (le_mdc_ProfileRef_t profileRef, le_mdc_Pdp_t pdp) |
le_mdc_Pdp_t | le_mdc_GetPDP (le_mdc_ProfileRef_t profileRef) |
le_result_t | le_mdc_SetAPN (le_mdc_ProfileRef_t profileRef, const char *LE_NONNULL apnStr) |
le_result_t | le_mdc_SetDefaultAPN (le_mdc_ProfileRef_t profileRef) |
le_result_t | le_mdc_GetAPN (le_mdc_ProfileRef_t profileRef, char *apnStr, size_t apnStrSize) |
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) |
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) |
uint32_t | le_mdc_NumProfiles (void) |
le_result_t | le_mdc_GetProfileFromApn (const char *LE_NONNULL apnStr, le_mdc_ProfileRef_t *profileRefPtr) |
le_mdc_DisconnectionReason_t | le_mdc_GetDisconnectionReasonExt (le_mdc_ProfileRef_t profileRef, le_mdc_Pdp_t pdpType) |
int32_t | le_mdc_GetPlatformSpecificDisconnectionCodeExt (le_mdc_ProfileRef_t profileRef, le_mdc_Pdp_t pdpType) |
void | le_mdc_GetPlatformSpecificFailureConnectionReasonExt (le_mdc_ProfileRef_t profileRef, le_mdc_Pdp_t pdpType, int32_t *failureTypePtr, int32_t *failureCodePtr) |
le_result_t | le_mdc_MapProfileOnNetworkInterface (le_mdc_ProfileRef_t profileRef, const char *LE_NONNULL interfaceName) |
le_result_t | le_mdc_GetProfileList (le_mdc_ProfileInfo_t *profileListPtr, size_t *profileListSizePtr) |
Detailed Description
Legato Modem Data Control include file.
Copyright (C) Sierra Wireless Inc.
Typedef Documentation
◆ le_mdc_DisconnectHandler_t
typedef void(* le_mdc_DisconnectHandler_t) (void *) |
Type for handler called when a server disconnects.
Function Documentation
◆ le_mdc_AddMtPdpSessionStateHandler()
le_mdc_MtPdpSessionStateHandlerRef_t le_mdc_AddMtPdpSessionStateHandler | ( | le_mdc_SessionStateHandlerFunc_t | handlerPtr, |
void * | contextPtr | ||
) |
Add handler function for EVENT 'le_mdc_MtPdpSessionState'
This event provides information on data session connection state changes for the given profileRef.
- Parameters
-
[in] handlerPtr [in] contextPtr
◆ le_mdc_AddSessionStateHandler()
le_mdc_SessionStateHandlerRef_t le_mdc_AddSessionStateHandler | ( | le_mdc_ProfileRef_t | profileRef, |
le_mdc_SessionStateHandlerFunc_t | handlerPtr, | ||
void * | contextPtr | ||
) |
Reference to a modem data connection profile. Enumeration of data bearer technologies. Enumeration of Packet Data Protocol. Authentication bit mask. Enumeration of connection state. Enumeration of the possible reasons for the disconnection. Handler for Data session connection state changes. Handler for MT-PDP Data session connection state changes. Handler for asynchronous session start and stop result response Reference type used by Add/Remove functions for EVENT 'le_mdc_SessionState' Reference type used by Add/Remove functions for EVENT 'le_mdc_MtPdpSessionState' This is the structure with info about a given cellular data profile Add handler function for EVENT 'le_mdc_SessionState'
This event provides information on data session connection state changes for the given profileRef.
- Parameters
-
[in] profileRef The profile object of interest [in] handlerPtr [in] contextPtr
◆ le_mdc_ConnectService()
void le_mdc_ConnectService | ( | void | ) |
Connect the current client thread to the service providing this API. Block until the service is available.
For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client-specific Functions.
This function is created automatically.
◆ le_mdc_DisconnectService()
void le_mdc_DisconnectService | ( | void | ) |
Disconnect the current client thread from the service providing this API.
Normally, this function doesn't need to be called. After this function is called, there's no longer a connection to the service, and the functions in this API can't be used. For details, see Client-specific Functions.
This function is created automatically.
◆ le_mdc_GetAPN()
le_result_t le_mdc_GetAPN | ( | le_mdc_ProfileRef_t | profileRef, |
char * | apnStr, | ||
size_t | apnStrSize | ||
) |
Get the Access Point Name (APN) for the given profile.
- Returns
- LE_OK on success
- LE_BAD_PARAMETER if an input parameter is not valid
- LE_OVERFLOW if the APN is is too long
- LE_FAULT on failed
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object [out] apnStr The Access Point Name [in] apnStrSize
◆ le_mdc_GetAuthentication()
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 | ||
) |
Get authentication property
- Returns
- LE_OK on success
- LE_BAD_PARAMETER if an input parameter is not valid
- LE_OVERFLOW userName or password are too small
- LE_FAULT on failed
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object [out] typePtr Authentication type [out] userName UserName used by authentication [in] userNameSize [out] password Password used by authentication [in] passwordSize
◆ le_mdc_GetBytesCounters()
le_result_t le_mdc_GetBytesCounters | ( | uint64_t * | rxBytesPtr, |
uint64_t * | txBytesPtr | ||
) |
Get number of bytes received/transmitted without error since the last reset.
- Returns
- LE_OK on success
- LE_FAULT for all other errors
- Note
- The process exits, if an invalid pointer is given
- Parameters
-
[out] rxBytesPtr bytes amount received since the last counter reset [out] txBytesPtr bytes amount transmitted since the last counter reset
◆ le_mdc_GetCidList()
le_result_t le_mdc_GetCidList | ( | uint8_t * | cidPtr, |
size_t * | cidSizePtr | ||
) |
Get the list of supported PDP context identifiers
- Returns
- LE_OK on success
- LE_BAD_PARAMETER if the input parameter is not valid
- LE_FAULT for other failures
- Parameters
-
[out] cidPtr List of supported PDP context identifiers [in,out] cidSizePtr
◆ le_mdc_GetDataBearerTechnology()
le_result_t le_mdc_GetDataBearerTechnology | ( | le_mdc_ProfileRef_t | profileRef, |
le_mdc_DataBearerTechnology_t * | downlinkDataBearerTechPtrPtr, | ||
le_mdc_DataBearerTechnology_t * | uplinkDataBearerTechPtrPtr | ||
) |
Get the Data Bearer Technology for the given profile, if the data session is connected.
- Returns
- LE_OK on success
- LE_FAULT for all other errors
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object [out] downlinkDataBearerTechPtrPtr downlink data bearer technology [out] uplinkDataBearerTechPtrPtr uplink data bearer technology
◆ le_mdc_GetDisconnectionReasonExt()
le_mdc_DisconnectionReason_t le_mdc_GetDisconnectionReasonExt | ( | le_mdc_ProfileRef_t | profileRef, |
le_mdc_Pdp_t | pdpType | ||
) |
Called to get the disconnection reason.
- Returns
- The disconnection reason.
- Warning
- The return value le_mdc_DisconnectionReason_t might be limited by the platform. Please refer to the platform documentation Modem Control platform constraints.
- Note
- If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
- For IPv4v6 mode, pdpType specifies which session's disconnect reason to get(IPv4 or IPv6 session). For IPv4 and IPv6 mode, pdpType is ignored because there is only one session for IPv4 and IPv6 mode.
- Parameters
-
[in] profileRef profile reference [in] pdpType pdp type of session
◆ le_mdc_GetInterfaceName()
le_result_t le_mdc_GetInterfaceName | ( | le_mdc_ProfileRef_t | profileRef, |
char * | interfaceName, | ||
size_t | interfaceNameSize | ||
) |
Get the network interface name, if the data session is connected.
- Returns
- LE_OK on success
- LE_OVERFLOW if the interface name would not fit in interfaceNameStr
- LE_FAULT for all other errors
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object [out] interfaceName The name of the network interface [in] interfaceNameSize
◆ le_mdc_GetIPv4Address()
le_result_t le_mdc_GetIPv4Address | ( | le_mdc_ProfileRef_t | profileRef, |
char * | ipAddr, | ||
size_t | ipAddrSize | ||
) |
Get the IPv4 address for the given profile, if the data session is connected and has an IPv4 address.
- Returns
- LE_OK on success
- LE_OVERFLOW if the IP address would not fit in ipAddrStr
- LE_FAULT for all other errors
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object [out] ipAddr The IP address in dotted format [in] ipAddrSize
◆ le_mdc_GetIPv4DNSAddresses()
le_result_t le_mdc_GetIPv4DNSAddresses | ( | le_mdc_ProfileRef_t | profileRef, |
char * | dns1AddrStr, | ||
size_t | dns1AddrStrSize, | ||
char * | dns2AddrStr, | ||
size_t | dns2AddrStrSize | ||
) |
Get the primary/secondary DNS v4 addresses for the given profile, if the data session is connected and has an IPv4 address.
- Returns
- LE_OK on success
- LE_OVERFLOW if the IP address would not fit in buffer
- LE_FAULT for all other errors
- Note
- If only one DNS address is available, then it will be returned, and an empty string will be returned for the unavailable address
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object [out] dns1AddrStr The primary DNS IP address in dotted format [in] dns1AddrStrSize [out] dns2AddrStr The secondary DNS IP address in dotted format [in] dns2AddrStrSize
◆ le_mdc_GetIPv4GatewayAddress()
le_result_t le_mdc_GetIPv4GatewayAddress | ( | le_mdc_ProfileRef_t | profileRef, |
char * | gatewayAddr, | ||
size_t | gatewayAddrSize | ||
) |
Get the gateway IPv4 address for the given profile, if the data session is connected and has an IPv4 address.
- Returns
- LE_OK on success
- LE_OVERFLOW if the IP address would not fit in gatewayAddrStr
- LE_FAULT for all other errors
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object [out] gatewayAddr The gateway IP address in dotted format [in] gatewayAddrSize
◆ le_mdc_GetIPv6Address()
le_result_t le_mdc_GetIPv6Address | ( | le_mdc_ProfileRef_t | profileRef, |
char * | ipAddr, | ||
size_t | ipAddrSize | ||
) |
Get the IPv6 address for the given profile, if the data session is connected and has an IPv6 address.
- Returns
- LE_OK on success
- LE_OVERFLOW if the IP address would not fit in ipAddrStr
- LE_FAULT for all other errors
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object [out] ipAddr The IP address in dotted format [in] ipAddrSize
◆ le_mdc_GetIPv6DNSAddresses()
le_result_t le_mdc_GetIPv6DNSAddresses | ( | le_mdc_ProfileRef_t | profileRef, |
char * | dns1AddrStr, | ||
size_t | dns1AddrStrSize, | ||
char * | dns2AddrStr, | ||
size_t | dns2AddrStrSize | ||
) |
Get the primary/secondary DNS v6 addresses, if the data session is connected and has an IPv6 address.
- Returns
- LE_OK on success
- LE_OVERFLOW if the IP address can't fit in buffer
- LE_FAULT for all other errors
- Note
- If only one DNS address is available, it will be returned, and an empty string will be returned for the unavailable address.
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object [out] dns1AddrStr The primary DNS IP address in dotted format [in] dns1AddrStrSize [out] dns2AddrStr The secondary DNS IP address in dotted format [in] dns2AddrStrSize
◆ le_mdc_GetIPv6GatewayAddress()
le_result_t le_mdc_GetIPv6GatewayAddress | ( | le_mdc_ProfileRef_t | profileRef, |
char * | gatewayAddr, | ||
size_t | gatewayAddrSize | ||
) |
Get the gateway IPv6 address for the given profile, if the data session is connected and has an IPv6 address.
- Returns
- LE_OK on success
- LE_OVERFLOW if the IP address would not fit in gatewayAddrStr
- LE_FAULT for all other errors
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object [out] gatewayAddr The gateway IP address in dotted format [in] gatewayAddrSize
◆ le_mdc_GetPDP()
le_mdc_Pdp_t le_mdc_GetPDP | ( | le_mdc_ProfileRef_t | profileRef | ) |
Get the Packet Data Protocol (PDP) for the given profile.
- Returns
- packet data protocol value
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object
◆ le_mdc_GetPlatformSpecificDisconnectionCodeExt()
int32_t le_mdc_GetPlatformSpecificDisconnectionCodeExt | ( | le_mdc_ProfileRef_t | profileRef, |
le_mdc_Pdp_t | pdpType | ||
) |
Called to get the platform specific disconnection code.
Refer to Platform specific error codes for platform specific disconnection code description.
- Returns
- The platform specific disconnection code.
- Note
- If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
- For IPv4v6 mode, pdpType specifies which session's disconnect reason to get(IPv4 or IPv6 session). For IPv4 and IPv6 mode, pdpType is ignored because there is only one session for IPv4 and IPv6 mode.
- Parameters
-
[in] profileRef profile reference [in] pdpType pdp type of session
◆ le_mdc_GetPlatformSpecificFailureConnectionReasonExt()
void le_mdc_GetPlatformSpecificFailureConnectionReasonExt | ( | le_mdc_ProfileRef_t | profileRef, |
le_mdc_Pdp_t | pdpType, | ||
int32_t * | failureTypePtr, | ||
int32_t * | failureCodePtr | ||
) |
Called to get the platform specific connection failure reason.
Refer to Platform specific error codes for platform specific connection failure types and code descriptions.
- Note
- If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
- For IPv4v6 mode, pdpType specifies which session's disconnect reason to get(IPv4 or IPv6 session). For IPv4 and IPv6 mode, pdpType is ignored because there is only one session for IPv4 and IPv6 mode.
- Parameters
-
[in] profileRef profile reference [in] pdpType pdp type of session [out] failureTypePtr platform specific failure type [out] failureCodePtr platform specific failure code
◆ le_mdc_GetProfile()
le_mdc_ProfileRef_t le_mdc_GetProfile | ( | uint32_t | index | ) |
Get Profile Reference for index
- Note
- Create a new profile if the profile's index can't be found.
- Warning
- 0 is not a valid index.
- Ensure to check the list of supported data profiles for your specific platform.
- Returns
- Reference to the data profile
- NULL if the profile index does not exist
- Parameters
-
[in] index index of the profile.
◆ le_mdc_GetProfileFromApn()
le_result_t le_mdc_GetProfileFromApn | ( | const char *LE_NONNULL | apnStr, |
le_mdc_ProfileRef_t * | profileRefPtr | ||
) |
Get a profile selected by its APN
- Returns
- LE_OK on success
- LE_BAD_PARAMETER if an input parameter is not valid
- LE_NOT_FOUND if the requested APN is not found
- Parameters
-
[in] apnStr The Access Point Name [out] profileRefPtr profile reference
◆ le_mdc_GetProfileIndex()
uint32_t le_mdc_GetProfileIndex | ( | le_mdc_ProfileRef_t | profileRef | ) |
Get the index for the given Profile.
- Returns
- index of the profile in the modem
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object
◆ le_mdc_GetProfileList()
le_result_t le_mdc_GetProfileList | ( | le_mdc_ProfileInfo_t * | profileListPtr, |
size_t * | profileListSizePtr | ||
) |
Get the list of available profiles
- Returns
- list of available profiles
- LE_OK if the retrieval is successful; otherwise, some error code
- Parameters
-
[out] profileListPtr list of available profiles [in,out] profileListSizePtr
◆ le_mdc_GetSessionState()
le_result_t le_mdc_GetSessionState | ( | le_mdc_ProfileRef_t | profileRef, |
le_mdc_ConState_t * | connectionStatePtr | ||
) |
Get the current data session state.
- Returns
- LE_OK on success
- LE_BAD_PARAMETER if an input parameter is not valid
- LE_FAULT on failure
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object [out] connectionStatePtr The data session state
◆ le_mdc_IsIPv4()
bool le_mdc_IsIPv4 | ( | le_mdc_ProfileRef_t | profileRef | ) |
Allow the caller to know if the given profile is actually supporting IPv4, if the data session is connected.
- Returns
- TRUE if PDP type is IPv4, FALSE otherwise.
- Note
- If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
- Parameters
-
[in] profileRef Query this profile object
◆ le_mdc_IsIPv6()
bool le_mdc_IsIPv6 | ( | le_mdc_ProfileRef_t | profileRef | ) |
Allow the caller to know if the given profile is actually supporting IPv6, if the data session is connected.
- Returns
- TRUE if PDP type is IPv6, FALSE otherwise.
- Note
- If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
- Parameters
-
[in] profileRef Query this profile object
◆ le_mdc_MapProfileOnNetworkInterface()
le_result_t le_mdc_MapProfileOnNetworkInterface | ( | le_mdc_ProfileRef_t | profileRef, |
const char *LE_NONNULL | interfaceName | ||
) |
Map a profile on a network interface
- Returns
- LE_OK on success
- LE_UNSUPPORTED if not supported by the target
- LE_FAULT for all other errors
- Parameters
-
[in] profileRef Profile reference [in] interfaceName Network interface name
◆ le_mdc_NumProfiles()
uint32_t le_mdc_NumProfiles | ( | void | ) |
Get the number of profiles on the modem.
- Returns
- number of profiles existing on modem
◆ le_mdc_RejectMtPdpSession()
le_result_t le_mdc_RejectMtPdpSession | ( | le_mdc_ProfileRef_t | profileRef | ) |
Reject MT-PDP profile data session.
- Returns
- LE_OK on success
- LE_BAD_PARAMETER if the input parameter is not valid
- LE_UNSUPPORTED if not supported by the target
- LE_FAULT for other failures
- Note
- The process exits, if an invalid profile object is given
- Warning
- The MT-PDP context activation feature is not supported on all platforms. Please refer to Mobile Terminated PDP context section for full details.
- Parameters
-
[in] profileRef Reject MT-PDP data session for this profile object
◆ le_mdc_RemoveMtPdpSessionStateHandler()
void le_mdc_RemoveMtPdpSessionStateHandler | ( | le_mdc_MtPdpSessionStateHandlerRef_t | handlerRef | ) |
Remove handler function for EVENT 'le_mdc_MtPdpSessionState'
- Parameters
-
[in] handlerRef
◆ le_mdc_RemoveSessionStateHandler()
void le_mdc_RemoveSessionStateHandler | ( | le_mdc_SessionStateHandlerRef_t | handlerRef | ) |
Remove handler function for EVENT 'le_mdc_SessionState'
- Parameters
-
[in] handlerRef
◆ le_mdc_ResetBytesCounter()
le_result_t le_mdc_ResetBytesCounter | ( | void | ) |
Reset received/transmitted data flow statistics
- Returns
- LE_OK on success
- LE_FAULT for all other errors
◆ le_mdc_SetAPN()
le_result_t le_mdc_SetAPN | ( | le_mdc_ProfileRef_t | profileRef, |
const char *LE_NONNULL | apnStr | ||
) |
Set the Access Point Name (APN) for the given profile.
The APN must be an ASCII string.
- Returns
- LE_OK on success
- LE_BAD_PARAMETER if an input parameter is not valid
- LE_FAULT if the data session is currently connected for the given profile
- Note
- If APN is too long (max APN_NAME_MAX_LEN digits), it is a fatal error, the function will not return.
- Warning
- The maximum APN length might be limited by the platform. Please refer to the platform documentation Modem Control platform constraints.
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object [in] apnStr The Access Point Name
◆ le_mdc_SetAuthentication()
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 | ||
) |
Set authentication property
- Returns
- LE_OK on success
- Note
- The process exits, if userName or password are NULL when type is not PA_MDC_AUTH_NONE
- The process exits, if an invalid profile object is given
- If userName is too long (max USER_NAME_MAX_LEN digits), it is a fatal error, the function will not return.
- If password is too long (max PASSWORD_NAME_MAX_LEN digits), it is a fatal error, the function will not return.
- Both PAP and CHAP authentication can be set for 3GPP network: in this case, the device decides which authentication procedure is performed. For example, the device can have a policy to select the most secure authentication mechanism.
- Parameters
-
[in] profileRef Query this profile object [in] type Authentication type [in] userName UserName used by authentication [in] password Password used by authentication
◆ le_mdc_SetDefaultAPN()
le_result_t le_mdc_SetDefaultAPN | ( | le_mdc_ProfileRef_t | profileRef | ) |
Set the Access Point Name (APN) for the given profile according to the SIM identification number (ICCID). If no APN is found using the ICCID, fall back on the home network (MCC/MNC) to determine the default APN.
- Returns
- LE_OK on success
- LE_BAD_PARAMETER if an input parameter is not valid
- LE_FAULT for all other errors
- Note
- The process exits if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object
◆ le_mdc_SetPDP()
le_result_t le_mdc_SetPDP | ( | le_mdc_ProfileRef_t | profileRef, |
le_mdc_Pdp_t | pdp | ||
) |
Set the Packet Data Protocol (PDP) for the given profile.
- Returns
- LE_OK on success
- LE_BAD_PARAMETER if the PDP is not supported
- LE_FAULT if the data session is currently connected for the given profile
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Query this profile object [in] pdp The Packet Data Protocol
◆ le_mdc_SetServerDisconnectHandler()
LE_FULL_API void le_mdc_SetServerDisconnectHandler | ( | le_mdc_DisconnectHandler_t | disconnectHandler, |
void * | contextPtr | ||
) |
Set handler called when server disconnection is detected.
When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants to continue without exiting, it should call longjmp() from inside the handler.
◆ le_mdc_StartBytesCounter()
le_result_t le_mdc_StartBytesCounter | ( | void | ) |
Start collecting received/transmitted data flow statistics
- Returns
- LE_OK on success
- LE_FAULT for all other errors
◆ le_mdc_StartSession()
le_result_t le_mdc_StartSession | ( | le_mdc_ProfileRef_t | profileRef | ) |
Start profile data session.
- Returns
- LE_OK on success
- LE_BAD_PARAMETER if input parameter is incorrect
- LE_DUPLICATE if the data session is already connected for the given profile
- LE_TIMEOUT for session start timeout
- LE_FAULT for other failures
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Start data session for this profile object
◆ le_mdc_StartSessionAsync()
void le_mdc_StartSessionAsync | ( | le_mdc_ProfileRef_t | profileRef, |
le_mdc_SessionHandlerFunc_t | handlerPtr, | ||
void * | contextPtr | ||
) |
Start profile data session.
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Start data session for this profile object [in] handlerPtr Handler for start data session result [in] contextPtr
◆ le_mdc_StopBytesCounter()
le_result_t le_mdc_StopBytesCounter | ( | void | ) |
Stop collecting received/transmitted data flow statistics
- Returns
- LE_OK on success
- LE_FAULT for all other errors
◆ le_mdc_StopSession()
le_result_t le_mdc_StopSession | ( | le_mdc_ProfileRef_t | profileRef | ) |
Stop profile data session.
- Returns
- LE_OK on success
- LE_BAD_PARAMETER if the input parameter is not valid
- LE_FAULT for other failures
- Note
- The process exits, if an invalid profile object is given
- Warning
- The MT-PDP context activation feature is not supported on all platforms. Please refer to Mobile Terminated PDP context section for full details.
- Parameters
-
[in] profileRef Stop data session for this profile object
◆ le_mdc_StopSessionAsync()
void le_mdc_StopSessionAsync | ( | le_mdc_ProfileRef_t | profileRef, |
le_mdc_SessionHandlerFunc_t | handlerPtr, | ||
void * | contextPtr | ||
) |
Stop profile data session.
- Note
- The process exits, if an invalid profile object is given
- Parameters
-
[in] profileRef Stop data session for this profile object [in] handlerPtr Handler for stop data session result [in] contextPtr
◆ le_mdc_TryConnectService()
le_result_t le_mdc_TryConnectService | ( | void | ) |
Try to connect the current client thread to the service providing this API. Return with an error if the service is not available.
For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client-specific Functions.
This function is created automatically.
- Returns
- LE_OK if the client connected successfully to the service.
- LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
- LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
- LE_COMM_ERROR if the Service Directory cannot be reached.