![]() |
m2mb API docs
37.00.004.1
m2mb API sets documentation
|
Header file for m2mb_pdp APIs. More...
Go to the source code of this file.
Data Structures | |
| struct | M2MB_PDP_STATS_T |
Typedefs | |
| typedef HANDLE | M2MB_PDP_HANDLE |
| typedef void(* | m2mb_pdp_ind_callback) (M2MB_PDP_HANDLE h, M2MB_PDP_IND_E pdp_event, UINT8 cid, void *userdata) |
Enumerations | |
| enum | M2MB_PDP_IP_TYPE_E { M2MB_PDP_IPV4, M2MB_PDP_IPV6, M2MB_PDP_IPV4V6 } |
| enum | M2MB_PDP_TYPE_E { M2MB_PDP_TYPE_IPV4, M2MB_PDP_TYPE_PPP, M2MB_PDP_TYPE_IPV6, M2MB_PDP_TYPE_IPV4V6 } |
| enum | M2MB_PDP_AUTHTYPE_E { M2MB_PDP_AUTHTYPE_NOAUTH, M2MB_PDP_AUTHTYPE_PAP, M2MB_PDP_AUTHTYPE_CHAP } |
| enum | M2MB_PDP_IND_E { M2MB_PDP_UP, M2MB_PDP_DOWN } |
| enum | M2MB_PDP_DATAVOL_ACTION_E { M2MB_PDP_DATAVOL_RESET = 0, M2MB_PDP_DATAVOL_GET_SESSION = 1, M2MB_PDP_DATAVOL_GET_LIFE = 2 } |
| enum | M2MB_PDP_STATS_ACTION_E { M2MB_PDP_STATS_RESET, M2MB_PDP_STATS_GET_SESSION, M2MB_PDP_STATS_GET_LIFE } |
Functions | |
| M2MB_RESULT_E | m2mb_pdp_init (M2MB_PDP_HANDLE *h, m2mb_pdp_ind_callback callback, void *userdata) |
| m2mb_pdp_init initializes PDP service for current client. More... | |
| M2MB_RESULT_E | m2mb_pdp_deinit (M2MB_PDP_HANDLE h) |
| m2mb_pdp_deinit deinitializes PDP service for current client. More... | |
| M2MB_RESULT_E | m2mb_pdp_activate (M2MB_PDP_HANDLE h, UINT8 cid, CHAR *APN, CHAR *user, CHAR *password, M2MB_PDP_IP_TYPE_E pdpIPver) |
| m2mb_pdp_activate activates PDP context(or PDN connection) More... | |
| M2MB_RESULT_E | m2mb_pdp_deactivate (M2MB_PDP_HANDLE h, UINT8 cid) |
| m2mb_pdp_deactivate deactivates PDP context(or PDN connection) More... | |
| M2MB_RESULT_E | m2mb_pdp_get_my_ip (M2MB_PDP_HANDLE h, UINT8 cid, M2MB_PDP_IP_TYPE_E pdpIPver, void *addr) |
| m2mb_pdp_get_my_ip permits to get IP address More... | |
| M2MB_RESULT_E | m2mb_pdp_get_DNS (M2MB_PDP_HANDLE h, UINT8 cid, M2MB_PDP_IP_TYPE_E pdpIPver, void *pDNS, void *sDNS) |
| permits to get address of the DNS More... | |
| M2MB_RESULT_E | m2mb_pdp_get_status (M2MB_PDP_HANDLE h, UINT8 cid, UINT8 *p_status) |
| permits to get PDP context(or PDN connection) status More... | |
| M2MB_RESULT_E | m2mb_pdp_APN_set (M2MB_PDP_HANDLE h, UINT8 cid, CHAR *APN) |
| permits to set APN More... | |
| M2MB_RESULT_E | m2mb_pdp_APN_get (M2MB_PDP_HANDLE h, UINT8 cid, CHAR *APN, UINT8 len) |
| permits to get APN More... | |
| M2MB_RESULT_E | m2mb_pdp_apnclass2cid (M2MB_PDP_HANDLE h, UINT8 apnclass, UINT8 *p_cid) |
| permits to get cid related to specific APN class More... | |
| M2MB_RESULT_E | m2mb_pdp_type_get (M2MB_PDP_HANDLE h, UINT8 cid, M2MB_PDP_TYPE_E *pdp_type) |
| permits to get PDP Type More... | |
| M2MB_RESULT_E | m2mb_pdp_type_set (M2MB_PDP_HANDLE h, UINT8 cid, M2MB_PDP_TYPE_E pdp_type) |
| permits to set PDP Type More... | |
| M2MB_RESULT_E | m2mb_pdp_profile_name_get (M2MB_PDP_HANDLE h, UINT8 cid, CHAR *profname, UINT8 len) |
| permits to get Profile Name More... | |
| M2MB_RESULT_E | m2mb_pdp_profile_name_set (M2MB_PDP_HANDLE h, UINT8 cid, CHAR *profname) |
| permits to set Profile Name More... | |
| M2MB_RESULT_E | m2mb_pdp_authtype_get (M2MB_PDP_HANDLE h, UINT8 cid, M2MB_PDP_AUTHTYPE_E *pdp_authtype) |
| permits to get AUTH Type More... | |
| M2MB_RESULT_E | m2mb_pdp_authtype_set (M2MB_PDP_HANDLE h, UINT8 cid, M2MB_PDP_AUTHTYPE_E pdp_authtype) |
| permits to set AUTH Type More... | |
| M2MB_RESULT_E | m2mb_pdp_datavol_get (M2MB_PDP_HANDLE h, UINT8 cid, M2MB_PDP_DATAVOL_ACTION_E datavol_action, UINT32 *tx, UINT32 *rx) |
| allows to get data traffic statistics (in bytes) on a given PDP More... | |
| M2MB_RESULT_E | m2mb_pdp_stats (M2MB_PDP_HANDLE h, UINT8 cid, M2MB_PDP_STATS_ACTION_E stats_action, M2MB_PDP_STATS_T *stats) |
| allows to get bytes and packets statistics (in bytes) on a given PDP More... | |
| M2MB_RESULT_E | m2mb_pdp_default_cid_get (M2MB_PDP_HANDLE h, UINT8 *cid) |
| function used to get the dfefault PDP context number More... | |
Header file for m2mb_pdp APIs.
m2m/m2m_common/m2mb_inc/m2mb_pdp.h
m2m_pdp API actions and related parameters
@notes Dependencies:
| M2MB_RESULT_E m2mb_pdp_activate | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| CHAR * | APN, | ||
| CHAR * | user, | ||
| CHAR * | password, | ||
| M2MB_PDP_IP_TYPE_E | pdpIPver | ||
| ) |
m2mb_pdp_activate activates PDP context(or PDN connection)
m2mb_pdp_activate permits to activate PDP context(or PDN connection) for a specific cid
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | context identifier |
| [in] | APN | access point name |
| [in] | user | username if required by the APN |
| [in] | password | password if required by the APN |
| [in] | pdpIPver | pdp IP version(M2MB_PDP_IPV4V6 or M2MB_PDP_IPV6 or M2MB_PDP_IPV4) |
m2mb_pdp_activate(h,cid,apn,user,password,pdpIPver);
| M2MB_RESULT_E m2mb_pdp_APN_get | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| CHAR * | APN, | ||
| UINT8 | len | ||
| ) |
permits to get APN
permits to get APN for specific context identifier
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | context identifier |
| [in] | APN | buffer to retrieve APN |
| [in] | len | APN buffer length |
m2mb_pdp_APN_get(h,cid,apn,len);
| M2MB_RESULT_E m2mb_pdp_APN_set | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| CHAR * | APN | ||
| ) |
permits to set APN
permits to set APN for specific context identifier
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | context identifier |
| [in] | APN | access point name |
m2mb_pdp_APN_set(h,cid,apn);
| M2MB_RESULT_E m2mb_pdp_apnclass2cid | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | apnclass, | ||
| UINT8 * | p_cid | ||
| ) |
permits to get cid related to specific APN class
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | apnclass | apnclass to be given to get corresponding cid |
| [out] | p_cid | pointer to cid to be retrieved |
m2mb_pdp_apnclass2cid(h,apnclass,&cid);
| M2MB_RESULT_E m2mb_pdp_authtype_get | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| M2MB_PDP_AUTHTYPE_E * | pdp_authtype | ||
| ) |
permits to get AUTH Type
permits to get AUTH Type for specific context identifier
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | context identifier |
| [in] | pdp_authtype | to retrieve AUTH Type |
m2mb_pdp_authtype_get(h,cid,pdp_authtype);
| M2MB_RESULT_E m2mb_pdp_authtype_set | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| M2MB_PDP_AUTHTYPE_E | pdp_authtype | ||
| ) |
permits to set AUTH Type
permits to set AUTH Type for specific context identifier
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | context identifier |
| [in] | pdp_authtype | to set AUTH Type |
m2mb_pdp_authtype_set(h,cid,pdp_authtype);
| M2MB_RESULT_E m2mb_pdp_datavol_get | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| M2MB_PDP_DATAVOL_ACTION_E | datavol_action, | ||
| UINT32 * | tx, | ||
| UINT32 * | rx | ||
| ) |
allows to get data traffic statistics (in bytes) on a given PDP
allows to get data traffic statistics (in bytes) on a given PDP
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | PDP context identifier (value of 0 with action RESET, resets all counters). |
| [in] | datavol_action | to set the action (RESET / GET current session counters / GET life counters). |
| [out] | tx | pointer to retreive sent bytes statistics |
| [out] | rx | pointer to retreive received bytes statistics |
m2mb_pdp_datavol_get(h,cid,datavol_action,tx,rx);
| M2MB_RESULT_E m2mb_pdp_deactivate | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid | ||
| ) |
m2mb_pdp_deactivate deactivates PDP context(or PDN connection)
m2mb_pdp_deactivate permits to deactivate PDP context(or PDN connection) for a specific cid
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | context identifier |
m2mb_pdp_deactivate(h,cid);
| M2MB_RESULT_E m2mb_pdp_default_cid_get | ( | M2MB_PDP_HANDLE | h, |
| UINT8 * | cid | ||
| ) |
function used to get the dfefault PDP context number
the functions allows to get the default PDP context number based on the customization variant of the module
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [out] | cid | pointer to PDP context identifier. |
m2mb_pdp_default_cid_get(h,cid);
| M2MB_RESULT_E m2mb_pdp_deinit | ( | M2MB_PDP_HANDLE | h | ) |
m2mb_pdp_deinit deinitializes PDP service for current client.
m2mb_pdp_deinit deinitialize PDP service for current client freeing the handle passed as first parameter. Calling the m2mb_pdp_deinit is useful after using the PDP service in order to free memory space.
| [in] | h | parameter is the handle to the PDP service, that will be deinitialized by the function. |
m2mb_pdp_deinit(h);
| M2MB_RESULT_E m2mb_pdp_get_DNS | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| M2MB_PDP_IP_TYPE_E | pdpIPver, | ||
| void * | pDNS, | ||
| void * | sDNS | ||
| ) |
permits to get address of the DNS
permits to get IPV4 primary and secondary DNS or IPv6 primary and secondary DNS, for a specific cid
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | context identifier |
| [in] | pdpIPver | IP version(M2MB_PDP_IPV4 or M2MB_PDP_IPV6) |
| [out] | pDNS | pointer to IP address struct of the primary DNS to be filled in: in case of IPV4 address struct has to be M2MB_SOCKET_BSD_IN_ADDR, in case of IPv6 address struct has to be M2MB_SOCKET_BSD_IPV6_ADDR |
| [out] | sDNS | pointer to IP address struct of the secondary DNS to be filled in: in case of IPV4 address struct has to be M2MB_SOCKET_BSD_IN_ADDR, in case of IPv6 address struct has to be M2MB_SOCKET_BSD_IPV6_ADDR |
m2mb_pdp_get_DNS(h,cid,pDNS,sDNS);
| M2MB_RESULT_E m2mb_pdp_get_my_ip | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| M2MB_PDP_IP_TYPE_E | pdpIPver, | ||
| void * | addr | ||
| ) |
m2mb_pdp_get_my_ip permits to get IP address
m2mb_pdp_get_my_ip permits to get IP address obtained at PDP(or PDN) context activation for a specific cid
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | context identifier |
| [in] | pdpIPver | IP version(M2MB_PDP_IPV4 or M2MB_PDP_IPV6) |
| [out] | addr | pointer to IP address struct to be filled in: in case of IPV4 address struct has to be M2MB_SOCKET_BSD_IN_ADDR, in case of IPv6 address struct has to be M2MB_SOCKET_BSD_IPV6_ADDR |
m2mb_pdp_get_my_ip(h,cid,pdpIPver,addr);
| M2MB_RESULT_E m2mb_pdp_get_status | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| UINT8 * | p_status | ||
| ) |
permits to get PDP context(or PDN connection) status
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | context identifier |
| [out] | pointer | to PDP(or PDN) connection status for specific cid status 0: PDP inactive status 1: PDP active |
m2mb_pdp_get_status(h,cid,&status);
| M2MB_RESULT_E m2mb_pdp_init | ( | M2MB_PDP_HANDLE * | h, |
| m2mb_pdp_ind_callback | callback, | ||
| void * | userdata | ||
| ) |
m2mb_pdp_init initializes PDP service for current client.
m2mb_pdp_init initialize PDP service for current client returning the handle that must be passed as first parameter for all PDP actions. Calling the m2mb_pdp_init is mandatory before using the PDP service.
| [in] | *h | handle to the PDP service, that will be initialized by the function. |
| [in] | callback | callback that will be called if an event or a response happens. |
| [in] | userdata | pointer to generic user data that will be returned as it is in the callback. |
m2mb_pdp_init(&h, myCallback, myUserdata);
| M2MB_RESULT_E m2mb_pdp_profile_name_get | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| CHAR * | profname, | ||
| UINT8 | len | ||
| ) |
permits to get Profile Name
permits to get Profile Name for specific context identifier
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | context identifier |
| [in] | profname | buffer to retrieve Profile Name |
| [in] | len | Profile Name buffer length |
m2mb_pdp_profile_name_get(h, cid, profname, len);
| M2MB_RESULT_E m2mb_pdp_profile_name_set | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| CHAR * | profname | ||
| ) |
permits to set Profile Name
permits to set Profile Name for specific context identifier
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | context identifier |
| [in] | profname | buffer to set Profile Name |
m2mb_pdp_profile_name_set(h, cid, profname);
| M2MB_RESULT_E m2mb_pdp_stats | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| M2MB_PDP_STATS_ACTION_E | stats_action, | ||
| M2MB_PDP_STATS_T * | stats | ||
| ) |
allows to get bytes and packets statistics (in bytes) on a given PDP
allows to get bytes and packets statistics (in bytes) on a given PDP
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | PDP context identifier. |
| [in] | stats_action | to set the action. |
| [out] | stats | pointer to retrieve bytes and packets statistics. |
m2mb_pdp_stats(h,cid,datavol_action,stats);
| M2MB_RESULT_E m2mb_pdp_type_get | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| M2MB_PDP_TYPE_E * | pdp_type | ||
| ) |
permits to get PDP Type
permits to get PDP Type for specific context identifier
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | context identifier |
| [in] | pdp_type | to retrieve pdp IP Type |
m2mb_pdp_type_get(h,cid,&pdp_type);
| M2MB_RESULT_E m2mb_pdp_type_set | ( | M2MB_PDP_HANDLE | h, |
| UINT8 | cid, | ||
| M2MB_PDP_TYPE_E | pdp_type | ||
| ) |
permits to set PDP Type
permits to set PDP Type for specific context identifier
| [in] | h | handle to the PDP service, previously initialized by the m2mb_pdp_init function. |
| [in] | cid | context identifier |
| [in] | pdp_type | to set pdp IP Type |
m2mb_pdp_type_set(h,cid,pdp_type);