All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
pa_mdc.h File Reference
#include "legato.h"
#include "interfaces.h"

Go to the source code of this file.

Data Structures

struct  pa_mdc_Authentication_t
 
struct  pa_mdc_ProfileData_t
 
struct  pa_mdc_SessionStateData_t
 
struct  pa_mdc_PktStatistics_t
 

Macros

#define PA_MDC_MAX_PROFILE   5
 
#define PA_MDC_APN_MAX_LEN   LE_MDC_APN_NAME_MAX_LEN
 
#define PA_MDC_APN_MAX_BYTES   (PA_MDC_APN_MAX_LEN+1)
 
#define PA_MDC_USERNAME_MAX_LEN   LE_MDC_USER_NAME_MAX_LEN
 
#define PA_MDC_USERNAME_MAX_BYTES   (PA_MDC_USERNAME_MAX_LEN+1)
 
#define PA_MDC_PWD_MAX_LEN   LE_MDC_PASSWORD_NAME_MAX_LEN
 
#define PA_MDC_PWD_MAX_BYTES   (PA_MDC_PWD_MAX_LEN+1)
 

Typedefs

typedef void(* pa_mdc_SessionStateHandler_t )(pa_mdc_SessionStateData_t *sessionStatePtr)
 

Enumerations

enum  pa_mdc_SessionType_t { PA_MDC_SESSION_IPV4 =0, PA_MDC_SESSION_IPV6, PA_MDC_SESSION_IPV4V6 }
 
enum  pa_mdc_SessionState_t { PA_MDC_CONNECTED, PA_MDC_DISCONNECTED }
 

Functions

le_result_t pa_mdc_ReadProfile (uint32_t profileIndex, pa_mdc_ProfileData_t *profileDataPtr)
 
le_result_t pa_mdc_WriteProfile (uint32_t profileIndex, pa_mdc_ProfileData_t *profileDataPtr)
 
le_result_t pa_mdc_StartSessionIPV4 (uint32_t profileIndex, uint32_t *callRefPtr)
 
le_result_t pa_mdc_StartSessionIPV6 (uint32_t profileIndex, uint32_t *callRefPtr)
 
le_result_t pa_mdc_StartSessionIPV4V6 (uint32_t profileIndex, uint32_t *callRefPtr)
 
le_result_t pa_mdc_GetSessionType (uint32_t profileIndex, pa_mdc_SessionType_t *sessionIpPtr)
 
le_result_t pa_mdc_StopSession (uint32_t callRef)
 
le_result_t pa_mdc_GetSessionState (uint32_t profileIndex, pa_mdc_SessionState_t *sessionStatePtr)
 
void pa_mdc_SetSessionStateHandler (pa_mdc_SessionStateHandler_t handlerRef)
 
le_result_t pa_mdc_GetInterfaceName (uint32_t profileIndex, char *interfaceNameStr, size_t interfaceNameStrSize)
 
le_result_t pa_mdc_GetIPAddress (uint32_t profileIndex, le_mdmDefs_IpVersion_t ipVersion, char *ipAddrStr, size_t ipAddrStrSize)
 
le_result_t pa_mdc_GetGatewayAddress (uint32_t profileIndex, le_mdmDefs_IpVersion_t ipVersion, char *gatewayAddrStr, size_t gatewayAddrStrSize)
 
le_result_t pa_mdc_GetDNSAddresses (uint32_t profileIndex, le_mdmDefs_IpVersion_t ipVersion, char *dns1AddrStr, size_t dns1AddrStrSize, char *dns2AddrStr, size_t dns2AddrStrSize)
 
le_result_t pa_mdc_GetAccessPointName (uint32_t profileIndex, char *apnNameStr, size_t apnNameStrSize)
 
le_result_t pa_mdc_GetDataBearerTechnology (uint32_t profileIndex, le_mdc_DataBearerTechnology_t *downlinkDataBearerTechPtr, le_mdc_DataBearerTechnology_t *uplinkDataBearerTechPtr)
 
le_result_t pa_mdc_GetDataFlowStatistics (pa_mdc_PktStatistics_t *dataStatisticsPtr)
 
le_result_t pa_mdc_ResetDataFlowStatistics (void)
 

Detailed Description

Legato Modem Data Control Platform Adapter API include file.

Copyright (C) Sierra Wireless, Inc. 2014. Use of this work is subject to license.

Legato Modem Data Control Platform Adapter API include file.

Copyright (C) Sierra Wireless, Inc. 2013. All rights reserved. Use of this work is subject to license.

Macro Definition Documentation

#define PA_MDC_APN_MAX_BYTES   (PA_MDC_APN_MAX_LEN+1)

Define the maximum length for an APN null-ended string

#define PA_MDC_APN_MAX_LEN   LE_MDC_APN_NAME_MAX_LEN

Define the maximum size of various modem data profile related fields. Define the maximum length for an APN entry

#define PA_MDC_MAX_PROFILE   5

Maximum number of profile objects supported

#define PA_MDC_PWD_MAX_BYTES   (PA_MDC_PWD_MAX_LEN+1)

Define the maximum length for an password null-ended string

#define PA_MDC_PWD_MAX_LEN   LE_MDC_PASSWORD_NAME_MAX_LEN

Define the maximum length for a password entry

#define PA_MDC_USERNAME_MAX_BYTES   (PA_MDC_USERNAME_MAX_LEN+1)

Define the maximum length for an userName null-ended string

#define PA_MDC_USERNAME_MAX_LEN   LE_MDC_USER_NAME_MAX_LEN

Define the maximum length for an userName entry

Typedef Documentation

typedef void(* pa_mdc_SessionStateHandler_t)(pa_mdc_SessionStateData_t *sessionStatePtr)

Prototype for data session state handler function.

This handler will receive reports of any changes to the data session state.

Parameters
sessionStatePtrThe session state. Must be freed using le_mem_Release() when done.

Enumeration Type Documentation

Enumerates the possible values for the data session state

Enumerator
PA_MDC_CONNECTED 

Data session is connected.

PA_MDC_DISCONNECTED 

Data session is disconnected.

Session IP family

Enumerator
PA_MDC_SESSION_IPV4 

IP V4.

PA_MDC_SESSION_IPV6 

IP V6.

PA_MDC_SESSION_IPV4V6 

IP V4-V6.

Function Documentation

le_result_t pa_mdc_GetAccessPointName ( uint32_t  profileIndex,
char *  apnNameStr,
size_t  apnNameStrSize 
)

Get the Access Point Name for the given profile, if the data session is connected.

Returns
  • LE_OK on success
  • LE_OVERFLOW if the Access Point Name would not fit in apnNameStr
  • LE_NOT_POSSIBLE for all other errors
Parameters
[in]profileIndexThe profile to use
[out]apnNameStrThe Access Point Name
[in]apnNameStrSizeThe size in bytes of the address buffer
le_result_t pa_mdc_GetDataBearerTechnology ( uint32_t  profileIndex,
le_mdc_DataBearerTechnology_t downlinkDataBearerTechPtr,
le_mdc_DataBearerTechnology_t uplinkDataBearerTechPtr 
)

Get the Data Bearer Technology for the given profile, if the data session is connected.

Returns
  • LE_OK on success
  • LE_NOT_POSSIBLE for all other errors
Parameters
[in]profileIndexThe profile to use
[out]downlinkDataBearerTechPtrdownlink data bearer technology
[out]uplinkDataBearerTechPtruplink data bearer technology
le_result_t pa_mdc_GetDataFlowStatistics ( pa_mdc_PktStatistics_t dataStatisticsPtr)

Get data flow statistics since the last reset.

Returns
  • LE_OK on success
  • LE_NOT_POSSIBLE for all other errors
Parameters
[out]dataStatisticsPtrStatistics data
le_result_t pa_mdc_GetDNSAddresses ( uint32_t  profileIndex,
le_mdmDefs_IpVersion_t  ipVersion,
char *  dns1AddrStr,
size_t  dns1AddrStrSize,
char *  dns2AddrStr,
size_t  dns2AddrStrSize 
)

Get the primary/secondary DNS addresses for the given profile, if the data session is connected.

Returns
  • LE_OK on success
  • LE_OVERFLOW if the IP address would not fit in buffer
  • LE_NOT_POSSIBLE 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
Parameters
[in]profileIndexThe profile to use
[in]ipVersionIP Version
[out]dns1AddrStrThe primary DNS IP address in dotted format
[in]dns1AddrStrSizeThe size in bytes of the dns1AddrStr buffer
[out]dns2AddrStrThe secondary DNS IP address in dotted format
[in]dns2AddrStrSizeThe size in bytes of the dns2AddrStr buffer
le_result_t pa_mdc_GetGatewayAddress ( uint32_t  profileIndex,
le_mdmDefs_IpVersion_t  ipVersion,
char *  gatewayAddrStr,
size_t  gatewayAddrStrSize 
)

Get the gateway IP address for the given profile, if the data session is connected.

Returns
  • LE_OK on success
  • LE_OVERFLOW if the IP address would not fit in gatewayAddrStr
  • LE_NOT_POSSIBLE for all other errors
Parameters
[in]profileIndexThe profile to use
[in]ipVersionIP Version
[out]gatewayAddrStrThe gateway IP address in dotted format
[in]gatewayAddrStrSizeThe size in bytes of the address buffer
le_result_t pa_mdc_GetInterfaceName ( uint32_t  profileIndex,
char *  interfaceNameStr,
size_t  interfaceNameStrSize 
)

Get the name of the network interface for the given profile, if the data session is connected.

Returns
  • LE_OK on success
  • LE_OVERFLOW if the interface name would not fit in interfaceNameStr
  • LE_NOT_POSSIBLE for all other errors
Parameters
[in]profileIndexThe profile to use
[out]interfaceNameStrThe name of the network interface
[in]interfaceNameStrSizeThe size in bytes of the name buffer
le_result_t pa_mdc_GetIPAddress ( uint32_t  profileIndex,
le_mdmDefs_IpVersion_t  ipVersion,
char *  ipAddrStr,
size_t  ipAddrStrSize 
)

Get the IP address for the given profile, if the data session is connected.

Returns
  • LE_OK on success
  • LE_OVERFLOW if the IP address would not fit in gatewayAddrStr
  • LE_NOT_POSSIBLE for all other errors
Parameters
[in]profileIndexThe profile to use
[in]ipVersionIP Version
[out]ipAddrStrThe IP address in dotted format
[in]ipAddrStrSizeThe size in bytes of the address buffer
le_result_t pa_mdc_GetSessionState ( uint32_t  profileIndex,
pa_mdc_SessionState_t sessionStatePtr 
)

Get the session state for the given profile

Returns
  • LE_OK on success
  • LE_NOT_POSSIBLE on error
Parameters
[in]profileIndexThe profile to use
[out]sessionStatePtrThe data session state
le_result_t pa_mdc_GetSessionType ( uint32_t  profileIndex,
pa_mdc_SessionType_t sessionIpPtr 
)

Get session type for the given profile ( IP V4 or V6 )

Returns
  • LE_OK on success
  • LE_NOT_POSSIBLE for other failures
Parameters
[in]profileIndexThe profile to use
[out]sessionIpPtrIP family session
le_result_t pa_mdc_ReadProfile ( uint32_t  profileIndex,
pa_mdc_ProfileData_t profileDataPtr 
)

Read the profile data for the given profile

Returns
  • LE_OK on success
  • LE_NOT_POSSIBLE on failure
Parameters
[in]profileIndexThe profile to read
[out]profileDataPtrThe profile data
le_result_t pa_mdc_ResetDataFlowStatistics ( void  )

Reset data flow statistics

  • Returns
    • LE_OK on success
    • LE_NOT_POSSIBLE for all other errors
void pa_mdc_SetSessionStateHandler ( pa_mdc_SessionStateHandler_t  handlerRef)

Register a handler for session state notifications.

If the handler is NULL, then the previous handler will be removed.

Note
The process exits on failure
Parameters
[in]handlerRefThe session state handler function.
le_result_t pa_mdc_StartSessionIPV4 ( uint32_t  profileIndex,
uint32_t *  callRefPtr 
)

Start a data session with the given profile using IPV4

Returns
  • LE_OK on success
  • LE_DUPLICATE if the data session is already connected
  • LE_NOT_POSSIBLE for other failures
Parameters
[in]profileIndexThe profile to use
[out]callRefPtrReference used for stopping the data session
le_result_t pa_mdc_StartSessionIPV4V6 ( uint32_t  profileIndex,
uint32_t *  callRefPtr 
)

Start a data session with the given profile using IPV4-V6

Returns
  • LE_OK on success
  • LE_DUPLICATE if the data session is already connected
  • LE_NOT_POSSIBLE for other failures
Parameters
[in]profileIndexThe profile to use
[out]callRefPtrReference used for stopping the data session
le_result_t pa_mdc_StartSessionIPV6 ( uint32_t  profileIndex,
uint32_t *  callRefPtr 
)

Start a data session with the given profile using IPV6

Returns
  • LE_OK on success
  • LE_DUPLICATE if the data session is already connected
  • LE_NOT_POSSIBLE for other failures
Parameters
[in]profileIndexThe profile to use
[out]callRefPtrReference used for stopping the data session
le_result_t pa_mdc_StopSession ( uint32_t  callRef)

Stop a data session for the given profile

Returns
  • LE_OK on success
  • LE_DUPLICATE if the data session has already been stopped (i.e. it is disconnected)
  • LE_NOT_POSSIBLE for other failures
Parameters
[in]callRefThe call reference returned when starting the sessions
le_result_t pa_mdc_WriteProfile ( uint32_t  profileIndex,
pa_mdc_ProfileData_t profileDataPtr 
)

Write the profile data for the given profile

Returns
  • LE_OK on success
  • LE_NOT_POSSIBLE on failure
Parameters
[in]profileIndexThe profile to write
[in]profileDataPtrThe profile data