#include "legato.h"
Go to the source code of this file.
Macros | |
#define | LE_MDC_INTERFACE_NAME_MAX_LEN 10 |
#define | LE_MDC_INTERFACE_NAME_MAX_BYTES 11 |
#define | LE_MDC_IPV4_ADDR_MAX_LEN 15 |
#define | LE_MDC_IPV4_ADDR_MAX_BYTES 16 |
#define | LE_MDC_IPV6_ADDR_MAX_LEN 45 |
#define | LE_MDC_IPV6_ADDR_MAX_BYTES 46 |
#define | LE_MDC_APN_NAME_MAX_LEN 100 |
#define | LE_MDC_APN_NAME_MAX_BYTES 101 |
#define | LE_MDC_USER_NAME_MAX_LEN 64 |
#define | LE_MDC_USER_NAME_MAX_BYTES 65 |
#define | LE_MDC_PASSWORD_NAME_MAX_LEN 100 |
#define | LE_MDC_PASSWORD_NAME_MAX_BYTES 101 |
#define | LE_MDC_DEFAULT_PROFILE -1 |
Typedefs | |
typedef struct le_mdc_Profile * | le_mdc_ProfileRef_t |
typedef struct le_mdc_SessionStateHandler * | le_mdc_SessionStateHandlerRef_t |
typedef struct le_mdc_MtPdpSessionStateHandler * | le_mdc_MtPdpSessionStateHandlerRef_t |
typedef void(* | le_mdc_SessionStateHandlerFunc_t) (le_mdc_ProfileRef_t profileRef, le_mdc_ConState_t ConnectionState, void *contextPtr) |
typedef void(* | le_mdc_MtPdpSessionStateHandlerFunc_t) (le_mdc_ConState_t ConnectionState, void *contextPtr) |
Legato Modem Data Control include file.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
#define LE_MDC_APN_NAME_MAX_BYTES 101 |
Maximum number of bytes in a apn name (including the null-terminator).
#define LE_MDC_APN_NAME_MAX_LEN 100 |
Maximum number of bytes in a apn name (not including the null-terminator).
#define LE_MDC_DEFAULT_PROFILE -1 |
Default profile definition.
#define LE_MDC_INTERFACE_NAME_MAX_BYTES 11 |
Maximum number of bytes in a profile name (including the null-terminator).
#define LE_MDC_INTERFACE_NAME_MAX_LEN 10 |
Maximum number of bytes in a interface name (not including the null-terminator).
#define LE_MDC_IPV4_ADDR_MAX_BYTES 16 |
Maximum number of bytes in an IPv4 address (including the null-terminator).
#define LE_MDC_IPV4_ADDR_MAX_LEN 15 |
Maximum number of bytes in an IPv4 address (not including the null-terminator).
#define LE_MDC_IPV6_ADDR_MAX_BYTES 46 |
Maximum number of bytes in an IPv6 address (including the null-terminator).
#define LE_MDC_IPV6_ADDR_MAX_LEN 45 |
Maximum number of bytes in an IPv6 address (not including the null-terminator).
#define LE_MDC_PASSWORD_NAME_MAX_BYTES 101 |
Maximum number of bytes in a password name (including the null-terminator).
#define LE_MDC_PASSWORD_NAME_MAX_LEN 100 |
Maximum number of bytes in a password name (not including the null-terminator).
#define LE_MDC_USER_NAME_MAX_BYTES 65 |
Maximum number of bytes in a user name (including the null-terminator).
#define LE_MDC_USER_NAME_MAX_LEN 64 |
Maximum number of bytes in a user name (not including the null-terminator).
typedef void(* le_mdc_MtPdpSessionStateHandlerFunc_t) (le_mdc_ConState_t ConnectionState, void *contextPtr) |
Handler for MT-PDP Data session connection state changes.
ConnectionState | MT-PDP Data session connection state. |
contextPtr |
typedef struct le_mdc_MtPdpSessionStateHandler* le_mdc_MtPdpSessionStateHandlerRef_t |
Reference type used by Add/Remove functions for EVENT 'le_mdc_MtPdpSessionState'
typedef struct le_mdc_Profile* le_mdc_ProfileRef_t |
Reference to a modem data connection profile.
typedef void(* le_mdc_SessionStateHandlerFunc_t) (le_mdc_ProfileRef_t profileRef, le_mdc_ConState_t ConnectionState, void *contextPtr) |
Handler for Data session connection state changes.
profileRef | Profile reference |
ConnectionState | Data session connection state. |
contextPtr |
typedef struct le_mdc_SessionStateHandler* le_mdc_SessionStateHandlerRef_t |
Reference type used by Add/Remove functions for EVENT 'le_mdc_SessionState'
enum le_mdc_Auth_t |
enum le_mdc_ConState_t |
Enumeration of data bearer technologies.
Enumeration of the possible reasons for the disconnection.
enum le_mdc_Pdp_t |
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.
[in] | handlerPtr | |
[in] | contextPtr |
le_mdc_SessionStateHandlerRef_t le_mdc_AddSessionStateHandler | ( | le_mdc_ProfileRef_t | profileRef, |
le_mdc_SessionStateHandlerFunc_t | handlerPtr, | ||
void * | contextPtr | ||
) |
Add handler function for EVENT 'le_mdc_SessionState'
This event provides information on data session connection state changes for the given profileRef.
[in] | profileRef | The profile object of interest |
[in] | handlerPtr | |
[in] | contextPtr |
void le_mdc_ConnectService | ( | void | ) |
Connect the client to the service
void le_mdc_DisconnectService | ( | void | ) |
Disconnect the client from the service
le_result_t le_mdc_GetAPN | ( | le_mdc_ProfileRef_t | profileRef, |
char * | apnStr, | ||
size_t | apnStrNumElements | ||
) |
Get the Access Point Name (APN) for the given profile.
[in] | profileRef | Query this profile object |
[out] | apnStr | The Access Point Name |
[in] | apnStrNumElements |
le_result_t le_mdc_GetAuthentication | ( | le_mdc_ProfileRef_t | profileRef, |
le_mdc_Auth_t * | typePtr, | ||
char * | userName, | ||
size_t | userNameNumElements, | ||
char * | password, | ||
size_t | passwordNumElements | ||
) |
Get authentication property
[in] | profileRef | Query this profile object |
[out] | typePtr | Authentication type |
[out] | userName | UserName used by authentication |
[in] | userNameNumElements | |
[out] | password | Password used by authentication |
[in] | passwordNumElements |
le_result_t le_mdc_GetBytesCounters | ( | uint64_t * | rxBytesPtr, |
uint64_t * | txBytesPtr | ||
) |
Get number of bytes received/transmitted without error since the last reset.
[out] | rxBytesPtr | bytes amount received since the last counter reset |
[out] | txBytesPtr | bytes amount transmitted since the last counter reset |
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.
[in] | profileRef | Query this profile object |
[out] | downlinkDataBearerTechPtrPtr | downlink data bearer technology |
[out] | uplinkDataBearerTechPtrPtr | uplink data bearer technology |
le_mdc_DisconnectionReason_t le_mdc_GetDisconnectionReason | ( | le_mdc_ProfileRef_t | profileRef | ) |
Called to get the disconnection reason.
[in] | profileRef | profile reference |
le_result_t le_mdc_GetInterfaceName | ( | le_mdc_ProfileRef_t | profileRef, |
char * | interfaceName, | ||
size_t | interfaceNameNumElements | ||
) |
Get the network interface name, if the data session is connected.
[in] | profileRef | Query this profile object |
[out] | interfaceName | The name of the network interface |
[in] | interfaceNameNumElements |
le_result_t le_mdc_GetIPv4Address | ( | le_mdc_ProfileRef_t | profileRef, |
char * | ipAddr, | ||
size_t | ipAddrNumElements | ||
) |
Get the IPv4 address for the given profile, if the data session is connected and has an IPv4 address.
[in] | profileRef | Query this profile object |
[out] | ipAddr | The IP address in dotted format |
[in] | ipAddrNumElements |
le_result_t le_mdc_GetIPv4DNSAddresses | ( | le_mdc_ProfileRef_t | profileRef, |
char * | dns1AddrStr, | ||
size_t | dns1AddrStrNumElements, | ||
char * | dns2AddrStr, | ||
size_t | dns2AddrStrNumElements | ||
) |
Get the primary/secondary DNS v4 addresses for the given profile, if the data session is connected and has an IPv4 address.
[in] | profileRef | Query this profile object |
[out] | dns1AddrStr | The primary DNS IP address in dotted format |
[in] | dns1AddrStrNumElements | |
[out] | dns2AddrStr | The secondary DNS IP address in dotted format |
[in] | dns2AddrStrNumElements |
le_result_t le_mdc_GetIPv4GatewayAddress | ( | le_mdc_ProfileRef_t | profileRef, |
char * | gatewayAddr, | ||
size_t | gatewayAddrNumElements | ||
) |
Get the gateway IPv4 address for the given profile, if the data session is connected and has an IPv4 address.
[in] | profileRef | Query this profile object |
[out] | gatewayAddr | The gateway IP address in dotted format |
[in] | gatewayAddrNumElements |
le_result_t le_mdc_GetIPv6Address | ( | le_mdc_ProfileRef_t | profileRef, |
char * | ipAddr, | ||
size_t | ipAddrNumElements | ||
) |
Get the IPv6 address for the given profile, if the data session is connected and has an IPv6 address.
[in] | profileRef | Query this profile object |
[out] | ipAddr | The IP address in dotted format |
[in] | ipAddrNumElements |
le_result_t le_mdc_GetIPv6DNSAddresses | ( | le_mdc_ProfileRef_t | profileRef, |
char * | dns1AddrStr, | ||
size_t | dns1AddrStrNumElements, | ||
char * | dns2AddrStr, | ||
size_t | dns2AddrStrNumElements | ||
) |
Get the primary/secondary DNS v6 addresses, if the data session is connected and has an IPv6 address.
[in] | profileRef | Query this profile object |
[out] | dns1AddrStr | The primary DNS IP address in dotted format |
[in] | dns1AddrStrNumElements | |
[out] | dns2AddrStr | The secondary DNS IP address in dotted format |
[in] | dns2AddrStrNumElements |
le_result_t le_mdc_GetIPv6GatewayAddress | ( | le_mdc_ProfileRef_t | profileRef, |
char * | gatewayAddr, | ||
size_t | gatewayAddrNumElements | ||
) |
Get the gateway IPv6 address for the given profile, if the data session is connected and has an IPv6 address.
[in] | profileRef | Query this profile object |
[out] | gatewayAddr | The gateway IP address in dotted format |
[in] | gatewayAddrNumElements |
le_mdc_Pdp_t le_mdc_GetPDP | ( | le_mdc_ProfileRef_t | profileRef | ) |
Get the Packet Data Protocol (PDP) for the given profile.
[in] | profileRef | Query this profile object |
int32_t le_mdc_GetPlatformSpecificDisconnectionCode | ( | le_mdc_ProfileRef_t | profileRef | ) |
Called to get the platform specific disconnection code.
[in] | profileRef | profile reference |
le_mdc_ProfileRef_t le_mdc_GetProfile | ( | uint32_t | index | ) |
Get Profile Reference for index
[in] | index | index of the profile. |
le_result_t le_mdc_GetProfileFromApn | ( | const char * | apnStr, |
le_mdc_ProfileRef_t * | profileRefPtr | ||
) |
Get a profile selected by its APN
[in] | apnStr | The Access Point Name |
[out] | profileRefPtr | profile reference |
uint32_t le_mdc_GetProfileIndex | ( | le_mdc_ProfileRef_t | profileRef | ) |
Get the index for the given Profile.
[in] | profileRef | Query this profile object |
le_result_t le_mdc_GetSessionState | ( | le_mdc_ProfileRef_t | profileRef, |
le_mdc_ConState_t * | connectionStatePtr | ||
) |
Get the current data session state.
[in] | profileRef | Query this profile object |
[out] | connectionStatePtr | The data session state |
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.
[in] | profileRef | Query this profile object |
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.
[in] | profileRef | Query this profile object |
uint32_t le_mdc_NumProfiles | ( | void | ) |
Get the number of profiles on the modem.
le_result_t le_mdc_RejectMtPdpSession | ( | le_mdc_ProfileRef_t | profileRef | ) |
Reject MT-PDP profile data session.
[in] | profileRef | Reject MT-PDP data session for this profile object |
void le_mdc_RemoveMtPdpSessionStateHandler | ( | le_mdc_MtPdpSessionStateHandlerRef_t | addHandlerRef | ) |
Remove handler function for EVENT 'le_mdc_MtPdpSessionState'
[in] | addHandlerRef |
void le_mdc_RemoveSessionStateHandler | ( | le_mdc_SessionStateHandlerRef_t | addHandlerRef | ) |
Remove handler function for EVENT 'le_mdc_SessionState'
[in] | addHandlerRef |
le_result_t le_mdc_ResetBytesCounter | ( | void | ) |
Reset received/transmitted data flow statistics
le_result_t le_mdc_SetAPN | ( | le_mdc_ProfileRef_t | profileRef, |
const char * | apnStr | ||
) |
Set the Access Point Name (APN) for the given profile.
The APN must be an ASCII string.
[in] | profileRef | Query this profile object |
[in] | apnStr | The Access Point Name |
le_result_t le_mdc_SetAuthentication | ( | le_mdc_ProfileRef_t | profileRef, |
le_mdc_Auth_t | type, | ||
const char * | userName, | ||
const char * | password | ||
) |
Set authentication property
[in] | profileRef | Query this profile object |
[in] | type | Authentication type |
[in] | userName | UserName used by authentication |
[in] | password | Password used by authentication |
le_result_t le_mdc_SetDefaultAPN | ( | le_mdc_ProfileRef_t | profileRef | ) |
Set the Access Point Name (APN) for the given profile according to the home network mcc/mnc.
[in] | profileRef | Query this profile object |
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.
[in] | profileRef | Query this profile object |
[in] | pdp | The Packet Data Protocol |
le_result_t le_mdc_StartSession | ( | le_mdc_ProfileRef_t | profileRef | ) |
Start profile data session.
[in] | profileRef | Start data session for this profile object |
le_result_t le_mdc_StopSession | ( | le_mdc_ProfileRef_t | profileRef | ) |
Stop profile data session.
[in] | profileRef | Stop data session for this profile object |