m2mb API docs  30.00.008.1
m2mb API sets documentation
m2mb_net.h File Reference

Header file for m2mb_net APIs. More...

Go to the source code of this file.

Data Structures

struct  M2MB_NET_ERR_CAUSE_T
 
struct  M2MB_NET_GENERIC_RESP_T
 
struct  M2MB_NET_REG_STATUS_T
 
struct  M2MB_NET_GET_EDRX_INFO_RESP_T
 
struct  M2MB_NET_SIGNAL_INFO_UTRAN_T
 
struct  M2MB_NET_SIGNAL_INFO_EUTRAN_T
 
struct  M2MB_NET_GET_SIGNAL_INFO_RESP_T
 
struct  M2MB_NET_GET_BER_RESP_T
 
struct  M2M_T_NETWORK_CELL_NEIGHBOR_T
 
struct  M2MB_NET_CELL_GERAN_FULL_T
 
struct  M2MB_NET_CELL_GERAN_SUBSET1_T
 
struct  M2MB_NET_CELL_GERAN_SUBSET2_T
 
union  M2MB_NET_CELL_GERAN_U
 
struct  M2MB_NET_CELL_UTRAN_FULL_T
 
struct  M2MB_NET_CELL_UTRAN_SUBSET1_T
 
union  M2MB_NET_CELL_UTRAN_U
 
struct  M2MB_NET_CELL_EUTRAN_FULL_T
 
struct  M2MB_NET_CELL_EUTRAN_SUBSET1_T
 
union  M2MB_NET_CELL_EUTRAN_U
 
struct  M2MB_NET_CELL_NEIGHBOR_T
 
struct  M2MB_NET_GET_CURRENT_CELL_LIST_RESP_T
 
struct  M2MB_NET_GET_CURRENT_OPERATOR_INFO_RESP_T
 
struct  M2MB_NET_DESCRIPTION_T
 
struct  M2MB_NET_GET_AVAILABLE_NW_LIST_RESP_T
 
struct  M2MB_NET_SELECTED_WIRELESS_NETWORK_RESP_T
 

Typedefs

typedef HANDLE M2MB_NET_HANDLE
 
typedef struct M2MB_NET_CELL_NEIGHBOR_T M2MB_NET_CELL_NEIGHBOR_T
 
typedef struct M2MB_NET_DESCRIPTION_T M2MB_NET_DESCRIPTION_T
 
typedef void(* m2mb_net_ind_callback) (M2MB_NET_HANDLE h, M2MB_NET_IND_E net_event, UINT16 resp_size, void *resp_struct, void *userdata)
 

Enumerations

enum  M2MB_NET_ERRNO_E { M2MB_NET_SUCCESS, M2MB_NET_GENERIC_FAILURE }
 
enum  M2MB_NET_RAT_E {
  M2MB_NET_RAT_UNKNOWN = -1, M2MB_NET_RAT_GSM, M2MB_NET_RAT_GSM_Compact, M2MB_NET_RAT_UTRAN,
  M2MB_NET_RAT_GSM_wEGPRS, M2MB_NET_RAT_UTRAN_wHSDPA, M2MB_NET_RAT_UTRAN_wHSUPA, M2MB_NET_RAT_UTRAN_wHSDPAandHSUPA,
  M2MB_NET_RAT_EUTRAN, M2MB_NET_RAT_EC_GSM_IoT, M2MB_NET_RAT_EUTRAN_NB_S1
}
 
enum  M2MB_NET_STAT_E {
  M2MB_NET_STAT_NOT_REGISTERED, M2MB_NET_STAT_REGISTERED_HOME, M2MB_NET_STAT_SEARCHING, M2MB_NET_STAT_REGISTRATION_DENIED,
  M2MB_NET_STAT_UNKNOWN, M2MB_NET_STAT_REGISTERED_ROAMING
}
 
enum  M2MB_NET_AVAILABILITY_E { M2MB_NET_AVAILABILITY_UNKNOWN, M2MB_NET_AVAILABILITY_AVAILABLE, M2MB_NET_AVAILABILITY_CURRENT, M2MB_NET_AVAILABILITY_FORBIDDEN }
 
enum  M2MB_NET_IND_E {
  M2MB_NET_NULL_RESP, M2MB_NET_GET_SIGNAL_INFO_RESP, M2MB_NET_GET_BER_RESP, M2MB_NET_GET_CURRENT_OPERATOR_INFO_RESP,
  M2MB_NET_GET_CURRENT_CELL_LIST_RESP, M2MB_NET_GET_AVAILABLE_NW_LIST_RESP, M2MB_NET_GET_REG_STATUS_INFO_RESP, M2MB_NET_REG_STATUS_IND,
  M2MB_NET_GET_EDRX_INFO_RESP, M2MB_NET_SET_EDRX_INFO_RESP, M2MB_NET_ENABLE_IND_RESP
}
 
enum  M2MB_NET_ACTION_E { M2MB_NET_DUMMY, M2MB_NET_SET_ENABLE_IND_ASYNC, M2MB_NET_GET_ENABLE_IND_ASYNC }
 
enum  M2MB_NET_RESP_SET_E {
  M2MB_NET_RESP_SET_NONE, M2MB_NET_RESP_SET_FULL, M2MB_NET_RESP_SET_SUBSET1, M2MB_NET_RESP_SET_SUBSET2,
  M2MB_NET_RESP_SET_SUBSET3, M2MB_NET_RESP_SET_SUBSET4, M2MB_NET_RESP_SET_SUBSET5
}
 
enum  M2MB_NET_LTE_HANDOVER_E { M2MB_NET_LTE_HANDOVER_SERVING, M2MB_NET_LTE_HANDOVER_INTRA_FREQ, M2MB_NET_LTE_HANDOVER_INTER_FREQ }
 
enum  M2MB_NET_SRV_DOMAIN_E {
  M2MB_NET_SRV_DOMAIN_NO_SRV, M2MB_NET_SRV_DOMAIN_CS_ONLY, M2MB_NET_SRV_DOMAIN_PS_ONLY, M2MB_NET_SRV_DOMAIN_CS_PS,
  M2MB_NET_SRV_DOMAIN_CAMPED
}
 
enum  M2MB_NET_CELL_TYPE_E { M2MB_NET_CELL_TYPE_SERVING, M2MB_NET_CELL_TYPE_NEIGHBOR }
 
enum  M2MB_NET_ACC_TECH_TYPE_E {
  M2MB_NET_ACC_TECH_TYPE_NO_SRV, M2MB_NET_ACC_TECH_TYPE_CDMA_1X, M2MB_NET_ACC_TECH_TYPE_CDMA_1XEVDO, M2MB_NET_ACC_TECH_TYPE_AMPS,
  M2MB_NET_ACC_TECH_TYPE_GSM, M2MB_NET_ACC_TECH_TYPE_UMTS, M2MB_NET_ACC_TECH_TYPE_WLAN, M2MB_NET_ACC_TECH_TYPE_GPS,
  M2MB_NET_ACC_TECH_TYPE_LTE, M2MB_NET_ACC_TECH_TYPE_TDSCDMA, M2MB_NET_ACC_TECH_TYPE_LTE_M1, M2MB_NET_ACC_TECH_TYPE_LTE_NB1,
  M2MB_NET_ACC_TECH_TYPE_MAX
}
 
enum  M2MB_NET_ERR_CAUSE_E { M2MB_NET_ERR_OK, M2MB_NET_ERR_UNKNOWN }
 
enum  M2MB_NET_ENABLE_IND_ASYNC_E { M2MB_NET_ENABLE_IND_ASYNC_DISABLED, M2MB_NET_ENABLE_IND_ASYNC_ENABLED }
 
enum  M2MB_NET_SELECTED_WIRELESS_NETWORK_E {
  M2MB_NET_SELECTED_WIRELESS_GERAN = 12, M2MB_NET_SELECTED_WIRELESS_UTRAN = 22, M2MB_NET_SELECTED_WIRELESS_GERAN_UTRAN_EUTRAN = 25, M2MB_NET_SELECTED_WIRELESS_EUTRAN = 28,
  M2MB_NET_SELECTED_WIRELESS_GERAN_UTRAN = 29, M2MB_NET_SELECTED_WIRELESS_GERAN_EUTRAN = 30, M2MB_NET_SELECTED_WIRELESS_UTRAN_EUTRAN = 31
}
 
enum  M2MB_NET_LTE_CIOT_PREFERENCE_E { M2MB_NET_LTE_CIOT_PREFERENCE_CAT_M1 = 0, M2MB_NET_LTE_CIOT_PREFERENCE_NB_IOT = 1, M2MB_NET_LTE_CIOT_PREFERENCE_CAT_M1_NB_IOT = 2 }
 

Functions

M2MB_RESULT_E m2mb_net_init (M2MB_NET_HANDLE *h, m2mb_net_ind_callback callback, void *userdata)
 m2mb_net_init initializes NET service for current client. More...
 
M2MB_RESULT_E m2mb_net_deinit (M2MB_NET_HANDLE h)
 m2mb_net_deinit deinitializes NET service for current client. More...
 
M2MB_RESULT_E m2mb_net_conf (M2MB_NET_HANDLE h, UINT8 argc,...)
 m2mb_net_conf sets/gets some NET parameters. More...
 
M2MB_RESULT_E m2mb_net_enable_ind (M2MB_NET_HANDLE h, M2MB_NET_IND_E ind, UINT8 enable)
 m2mb_net_enable_ind enables the indications of network state change events. More...
 
M2MB_RESULT_E m2mb_net_get_signal_info (M2MB_NET_HANDLE h)
 m2mb_net_get_signal_info gets information about signal strength. More...
 
M2MB_RESULT_E m2mb_net_get_ber (M2MB_NET_HANDLE h)
 m2mb_net_get_ber gets information about bit error rate. More...
 
M2MB_RESULT_E m2mb_net_get_wireless_network_selection (M2MB_NET_HANDLE h, M2MB_NET_SELECTED_WIRELESS_NETWORK_RESP_T *resp)
 m2mb_net_get_wireless_network_selection queries the modem for the wireless network selection and for the LTE camped IoT preference. More...
 
M2MB_RESULT_E m2mb_net_get_current_operator_info (M2MB_NET_HANDLE h)
 m2mb_net_get_current_operator_info gets information about current operator. More...
 
M2MB_RESULT_E m2mb_net_get_current_cell_list (M2MB_NET_HANDLE h)
 m2mb_net_get_current_cell_list gets a list containing current cell neighbors. More...
 
M2MB_RESULT_E m2mb_net_get_available_nw_list (M2MB_NET_HANDLE h)
 m2mb_net_get_available_nw_list gets a list containing current availble networks. More...
 
M2MB_RESULT_E m2mb_net_get_reg_status_info (M2MB_NET_HANDLE h)
 m2mb_net_get_reg_status_info gets information about regitration status. More...
 
M2MB_RESULT_E m2mb_net_get_edrx_info (M2MB_NET_HANDLE h, M2MB_NET_ACC_TECH_TYPE_E acc_tech)
 m2mb_net_get_edrx_info gets information about edrx. More...
 
M2MB_RESULT_E m2mb_net_set_edrx_info (M2MB_NET_HANDLE h, M2MB_NET_ACC_TECH_TYPE_E acc_tech, UINT8 edrx, UINT8 enabled)
 m2mb_net_set_edrx_info sets information about edrx. More...
 

Detailed Description

Header file for m2mb_net APIs.

m2m/m2m_common/m2mb_inc/m2mb_net.h

m2mb_net APIs provide actions and events for network events management.

Author
S. Passiu
Date
06/07/2017

Function Documentation

◆ m2mb_net_conf()

M2MB_RESULT_E m2mb_net_conf ( M2MB_NET_HANDLE  h,
UINT8  argc,
  ... 
)

m2mb_net_conf sets/gets some NET parameters.

m2mb_net_conf sets/gets NET parameters listed in the M2MB_NET_ACTION_E enum.

Parameters
[in]hHandle to the NET service, previously initialized by the m2mb_net_init function.
[in]argcIt determines the number of parameters that follows, plus one (e.g.: if two parameters follow, argc is 3).
[in]Itdetermines the action (among the ones listed in M2MB_NET_ACTION_E), while the parameters that follow depend on the action (see following note for further details).
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note
Action: M2MB_NET_SET_ENABLE_IND_ASYNC

Description: choose the behaviour of the m2mb_net_enable_ind function: synchronous (default) or asynchronous. The asynchronous mode can be necessary when the calling function can't be locked for long time (eg.: a callback function). In asynchronous mode, the result of the m2mb_net_enable_ind is confirmed by the M2MB_NET_ENABLE_IND_RESP event.

Params(in): h(M2MB_NET_HANDLE), 3, action(M2MB_NET_ACTION_E), syncOrAsync(M2MB_NET_ENABLE_IND_ASYNC_E)

  • example: set the m2mb_net_enable_ind function as asynchronous

m2mb_net_conf(h, 3, M2MB_NET_SET_ENABLE_IND_ASYNC, M2MB_NET_ENABLE_IND_ASYNC_ENABLED);

Action: M2MB_NET_GET_ENABLE_IND_ASYNC

Description: get the current status (synchronous or asynchronous) of the m2mb_net_enable_ind behaviour.

Params(in): h(M2MB_NET_HANDLE), 3, action(M2MB_NET_ACTION_E), syncOrAsync(M2MB_NET_ENABLE_IND_ASYNC_E*)

  • example: get current status

M2MB_NET_ENABLE_IND_ASYNC_E currentStatus; m2mb_net_conf(h, 3, M2MB_NET_GET_ENABLE_IND_ASYNC, &currentStatus);

◆ m2mb_net_deinit()

M2MB_RESULT_E m2mb_net_deinit ( M2MB_NET_HANDLE  h)

m2mb_net_deinit deinitializes NET service for current client.

m2mb_net_deinit deinitialize NET service for current client freeing the handle passed as first parameter. Calling the m2mb_net_deinit is useful after using the NET service in order to free memory space.

Parameters
[in]hIt is the handle to the NET service, that will be deinitialized by the function.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_net_deinit(&h);

M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_NET_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_net_init(&h, myCallback, (void*)myUserdata);
//... use NET APIs ...
retVal = m2mb_net_deinit(h);
if ( retVal == M2MB_RESULT_SUCCESS )
printf( "m2mb_net_deinit succeeded");

◆ m2mb_net_enable_ind()

M2MB_RESULT_E m2mb_net_enable_ind ( M2MB_NET_HANDLE  h,
M2MB_NET_IND_E  ind,
UINT8  enable 
)

m2mb_net_enable_ind enables the indications of network state change events.

m2mb_net_enable_ind enables the indications of network state change events through the callback function previously registerd with the m2mb_net_init.

Parameters
[in]hIt is the handle to the NET service, previously initialized by the m2mb_net_init function.
[in]indDetermines the event (among the ones ending with the _IND suffix, listed in M2MB_NET_IND_E) to be enabled/disabled.
[in]enableIt is 0 to disable or 1 to enable the event "ind".
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note
The indication event enabled with the m2mb_net_enable_ind will be received in the callback function previously registerd with the m2mb_net_init, when the event happens. If the event is M2MB_NET_REG_STATUS_IND the resp_struct must be casted to the M2MB_NET_REG_STATUS_T type.

m2mb_net_enable_ind(h, M2MB_NET_REG_STATUS_IND, 1);

void myCallback(M2MB_NET_HANDLE h, M2MB_NET_IND_E net_event, UINT16 resp_size, void *resp_struct, void *myUserdata)
{
switch(net_event)
{
//...
case M2MB_NET_REG_STATUS_IND:
{
printf( M2MB_TC_GENERIC, M2MB_TL_LOG, "Reg Status INDICATION: %d,%d,%d,%X,%lX", resp->rat, resp->stat, resp->srvDomain, resp->areaCode, resp->cellID );
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_NET_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_net_init(&h, myCallback, (void*)myUserdata);
retVal = m2mb_net_enable_ind(h, M2MB_NET_REG_STATUS_IND, 1);
if ( retVal == M2MB_RESULT_SUCCESS )
printf( "M2MB_NET_REG_STATUS_IND enabled");
}

◆ m2mb_net_get_available_nw_list()

M2MB_RESULT_E m2mb_net_get_available_nw_list ( M2MB_NET_HANDLE  h)

m2mb_net_get_available_nw_list gets a list containing current availble networks.

m2mb_net_get_available_nw_list gets a list containing current availble networks. The function is asynchronous. This means that the function returns immediately, but the signal information is received in the callback previously set by the m2mb_net_init function. The response event received in the callback will be the M2MB_NET_GET_AVAILABLE_NW_LIST_RESP. The resp_struct must be casted to the M2MB_NET_GET_AVAILABLE_NW_LIST_RESP_T type.

Parameters
[in]hIt is the handle to the NET service, previously initialized by the m2mb_net_init function.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_net_get_available_nw_list(h);

void myCallback(M2MB_NET_HANDLE h, M2MB_NET_IND_E net_event, UINT16 resp_size, void *resp_struct, void *myUserdata)
{
switch(net_event)
{
//...
case M2MB_NET_GET_AVAILABLE_NW_LIST_RESP:
{
printf("GET list length is %d", resp->availableNetworks_size);
listPnt = resp->availableNetworks;
while(listPnt != NULL)
{
printf("Available NW info are %d, %d, %d, %d", listPnt->mcc, listPnt->mnc, listPnt->networkAv, listPnt->rat);
listPnt = listPnt->next;
}
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_NET_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_net_init(&h, myCallback, (void*)myUserdata);
//...
if ( retVal == M2MB_RESULT_SUCCESS )
printf( "m2mb_net_get_available_nw_list request succeeded");
}

◆ m2mb_net_get_ber()

M2MB_RESULT_E m2mb_net_get_ber ( M2MB_NET_HANDLE  h)

m2mb_net_get_ber gets information about bit error rate.

m2mb_net_get_ber gets information about bit error rate of current network connection. The function is asynchronous. This means that the function returns immediately, but the signal information is received in the callback previously set by the m2mb_net_init function. The response event received in the callback will be the M2MB_NET_GET_BER_RESP. The resp_struct must be casted to the M2MB_NET_GET_BER_RESP_T type.

Parameters
[in]hIt is the handle to the NET service, previously initialized by the m2mb_net_init function.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_net_get_ber(h);

void myCallback(M2MB_NET_HANDLE h, M2MB_NET_IND_E net_event, UINT16 resp_size, void *resp_struct, void *myUserdata)
{
switch(net_event)
{
//...
case M2MB_NET_GET_BER_RESP:
{
printf("GET BER resp is %d, %d", resp->rat, resp->ber);
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_NET_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_net_init(&h, myCallback, (void*)myUserdata);
//...
retVal = m2mb_net_get_ber(h);
if ( retVal == M2MB_RESULT_SUCCESS )
printf( "m2mb_net_get_ber request succeeded");
}

◆ m2mb_net_get_current_cell_list()

M2MB_RESULT_E m2mb_net_get_current_cell_list ( M2MB_NET_HANDLE  h)

m2mb_net_get_current_cell_list gets a list containing current cell neighbors.

m2mb_net_get_current_cell_list gets a list containing current cell neighbors, including serving cell. The function is asynchronous. This means that the function returns immediately, but the signal information is received in the callback previously set by the m2mb_net_init function. The response event received in the callback will be the M2MB_NET_GET_CURRENT_CELL_LIST_RESP. The resp_struct must be casted to the M2MB_NET_GET_CURRENT_CELL_LIST_RESP_T type.

Parameters
[in]hIt is the handle to the NET service, previously initialized by the m2mb_net_init function.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_net_get_current_cell_list(h);

void myCallback(M2MB_NET_HANDLE h, M2MB_NET_IND_E net_event, UINT16 resp_size, void *resp_struct, void *myUserdata)
{
switch(net_event)
{
//...
case M2MB_NET_GET_CURRENT_CELL_LIST_RESP:
{
printf("GET list length is %d", resp->neighbors_size);
listPnt = resp->neighbors;
while(listPnt != NULL)
{
switch(listPnt->cellRat)
{
case M2MB_NET_RAT_GSM:
case M2MB_NET_RAT_GSM_Compact:
case M2MB_NET_RAT_GSM_wEGPRS:
{
M2MB_NET_CELL_GERAN_U *geranInfo = (M2MB_NET_CELL_GERAN_U*) listPnt->cell;
switch(listPnt->respSet)
{
M2MB_NET_RESP_SET_FULL:
printf("Geran Full info are %ld, %d, %d, %d, %ld, %d", geranInfo->full.cell_id, geranInfo->full.lac, geranInfo->full.arfcn, geranInfo->full.bsic, geranInfo->full.timing_advance, geranInfo->full.rx_lev);
break;
M2MB_NET_RESP_SET_SUBSET1:
printf("Geran sub1 info are %ld, %d, %d, %d, %d", geranInfo->subset1.cell_id, geranInfo->subset1.lac, geranInfo->subset1.arfcn, geranInfo->subset1.bsic, geranInfo->subset1.rx_lev);
break;
M2MB_NET_RESP_SET_SUBSET2:
printf("Geran sub2 info are %d, %d, %d", geranInfo->subset2.arfcn, geranInfo->subset2.bsic, geranInfo->subset2.rx_lev);
break;
default:
break;
}
break;
}
case M2MB_NET_RAT_UTRAN:
case M2MB_NET_RAT_UTRAN_wHSDPA:
case M2MB_NET_RAT_UTRAN_wHSUPA:
case M2MB_NET_RAT_UTRAN_wHSDPAandHSUPA:
{
M2MB_NET_CELL_UTRAN_U *utranInfo = (M2MB_NET_CELL_UTRAN_U*) listPnt->cell;
switch(listPnt->respSet)
{
M2MB_NET_RESP_SET_FULL:
printf("Utran Full info are %ld, %d, %d, %d, %d, %d", utranInfo->full.cell_id, utranInfo->full.lac, utranInfo->full.uarfcn, utranInfo->full.psc, utranInfo->full.rscp, utranInfo->full.ecio);
break;
M2MB_NET_RESP_SET_SUBSET1:
printf("Utran sub1 info are %d, %d, %d, %d", utranInfo->subset1.uarfcn, utranInfo->subset1.psc, utranInfo->subset1.rscp, utranInfo->subset1.ecio);
break;
default:
break;
}
break;
}
case M2MB_NET_RAT_EUTRAN:
{
M2MB_NET_CELL_EUTRAN_U *eutranInfo = (M2MB_NET_CELL_EUTRAN_U*) listPnt->cell;
switch(listPnt->respSet)
{
M2MB_NET_RESP_SET_FULL:
printf("Eutran Full info are %ld, %d, %d, %d, %d, %d, %d", eutranInfo->full.cell_id, eutranInfo->full.tac, eutranInfo->full.earfcn, eutranInfo->full.pci, eutranInfo->full.rsrq, eutranInfo->full.rsrp, eutranInfo->full.rx_lev);
break;
M2MB_NET_RESP_SET_SUBSET1:
printf("Eutran sub1 info are %d, %d, %d, %d", eutranInfo->subset1.earfcn, eutranInfo->subset1.pci, eutranInfo->subset1.rsrq, eutranInfo->subset1.rsrp, eutranInfo->subset1.rx_lev);
break;
default:
break;
}
break;
}
}
listPnt = listPnt->next;
}
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_NET_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_net_init(&h, myCallback, (void*)myUserdata);
//...
if ( retVal == M2MB_RESULT_SUCCESS )
printf( "m2mb_net_get_current_cell_list request succeeded");
}

◆ m2mb_net_get_current_operator_info()

M2MB_RESULT_E m2mb_net_get_current_operator_info ( M2MB_NET_HANDLE  h)

m2mb_net_get_current_operator_info gets information about current operator.

m2mb_net_get_current_operator_info gets information about current registered network operator. The function is asynchronous. This means that the function returns immediately, but the signal information is received in the callback previously set by the m2mb_net_init function. The response event received in the callback will be the M2MB_NET_GET_CURRENT_OPERATOR_INFO_RESP. The resp_struct must be casted to the M2MB_NET_GET_CURRENT_OPERATOR_INFO_RESP_T type.

Parameters
[in]hIt is the handle to the NET service, previously initialized by the m2mb_net_init function.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_net_get_current_operator_info(h);

void myCallback(M2MB_NET_HANDLE h, M2MB_NET_IND_E net_event, UINT16 resp_size, void *resp_struct, void *myUserdata)
{
switch(net_event)
{
//...
case M2MB_NET_GET_CURRENT_OPERATOR_INFO_RESP:
{
printf("GET curren operator resp is %d, %d", resp->mcc, resp->mnc);
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_NET_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_net_init(&h, myCallback, (void*)myUserdata);
//...
if ( retVal == M2MB_RESULT_SUCCESS )
printf( "m2mb_net_get_current_operator_info request succeeded");
}

◆ m2mb_net_get_edrx_info()

M2MB_RESULT_E m2mb_net_get_edrx_info ( M2MB_NET_HANDLE  h,
M2MB_NET_ACC_TECH_TYPE_E  acc_tech 
)

m2mb_net_get_edrx_info gets information about edrx.

m2mb_net_get_edrx_info gets information about edrx. The function is asynchronous. This means that the function returns immediately, but the signal information is received in the callback previously set by the m2mb_net_init function. The response event received in the callback will be the M2MB_NET_GET_EDRX_INFO_RESP. The resp_struct must be casted to the M2MB_NET_GET_EDRX_INFO_RESP_T type.

Parameters
[in]hIt is the handle to the NET service, previously initialized by the m2mb_net_init function.
[in]acc_techaccess technology to get eDRX.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_net_get_edrx_info(h, acc_tech);

void myCallback(M2MB_NET_HANDLE h, M2MB_NET_IND_E net_event, UINT16 resp_size, void *resp_struct, void *myUserdata)
{
switch(net_event)
{
//...
case M2MB_NET_GET_EDRX_INFO_RESP:
{
printf("GET NET edrx resp is err %d, acc_tech %d, edrx %d", resp->err, resp->acc_tech, resp->edrx);
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_NET_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_net_init(&h, myCallback, (void*)myUserdata);
//...
retVal = m2mb_net_get_edrx_info(h, M2MB_NET_ACC_TECH_TYPE_LTE);
if ( retVal == M2MB_RESULT_SUCCESS )
printf( "m2mb_net_get_edrx_info request succeeded");
}

◆ m2mb_net_get_reg_status_info()

M2MB_RESULT_E m2mb_net_get_reg_status_info ( M2MB_NET_HANDLE  h)

m2mb_net_get_reg_status_info gets information about regitration status.

m2mb_net_get_reg_status_info gets information about regitration status to the network. The function is asynchronous. This means that the function returns immediately, but the signal information is received in the callback previously set by the m2mb_net_init function. The response event received in the callback will be the M2MB_NET_GET_REG_STATUS_INFO_RESP. The resp_struct must be casted to the M2MB_NET_REG_STATUS_T type.

Parameters
[in]hIt is the handle to the NET service, previously initialized by the m2mb_net_init function.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_net_get_reg_status_info(h);

void myCallback(M2MB_NET_HANDLE h, M2MB_NET_IND_E net_event, UINT16 resp_size, void *resp_struct, void *myUserdata)
{
switch(net_event)
{
//...
case M2MB_NET_GET_REG_STATUS_INFO_RESP:
{
printf("GET NET status resp is %d, %d, %d, %d, %ld", resp->stat, resp->rat, resp->srvDomain, resp->areaCode, resp->cellID);
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_NET_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_net_init(&h, myCallback, (void*)myUserdata);
//...
if ( retVal == M2MB_RESULT_SUCCESS )
printf( "m2mb_net_get_reg_status_info request succeeded");
}

◆ m2mb_net_get_signal_info()

M2MB_RESULT_E m2mb_net_get_signal_info ( M2MB_NET_HANDLE  h)

m2mb_net_get_signal_info gets information about signal strength.

m2mb_net_get_signal_info gets information about signal strength. The function is asynchronous. This means that the function returns immediately, but the signal information is received in the callback previously set by the m2mb_net_init function. The response event received in the callback will be the M2MB_NET_GET_SIGNAL_INFO_RESP. The resp_struct must be casted to the M2MB_NET_GET_SIGNAL_INFO_RESP_T type.

Parameters
[in]hIt is the handle to the NET service, previously initialized by the m2mb_net_init function.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_net_get_signal_info(h);

void myCallback(M2MB_NET_HANDLE h, M2MB_NET_IND_E net_event, UINT16 resp_size, void *resp_struct, void *myUserdata)
{
switch(net_event)
{
//...
case M2MB_NET_GET_SIGNAL_INFO_RESP:
{
printf("GET Signal Info resp is %d, %d", resp->rat, resp->rssi);
if((resp->sigInfo != NULL) && (resp->rat == M2MB_NET_RAT_UTRAN) || ((resp->rat >= M2MB_NET_RAT_UTRAN_wHSDPA) && (resp->rat <= M2MB_NET_RAT_UTRAN_wHSDPAandHSUPA)))
{
printf("GET Signal Info resp is %d", tmpSigInfo->ecio);
}
else if((resp->sigInfo != NULL) && (resp->rat == M2MB_NET_RAT_EUTRAN))
{
printf("GET Signal Info resp is %d, %d, %d", tmpSigInfo->rsrq, tmpSigInfo->rsrp, tmpSigInfo->snr);
}
}
//...
}
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_NET_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_net_init(&h, myCallback, (void*)myUserdata);
//...
if ( retVal == M2MB_RESULT_SUCCESS )
printf( "m2mb_net_get_signal_info request succeeded");
}

◆ m2mb_net_get_wireless_network_selection()

M2MB_RESULT_E m2mb_net_get_wireless_network_selection ( M2MB_NET_HANDLE  h,
M2MB_NET_SELECTED_WIRELESS_NETWORK_RESP_T resp 
)

m2mb_net_get_wireless_network_selection queries the modem for the wireless network selection and for the LTE camped IoT preference.

m2mb_net_get_wireless_network_selection retrieves the same information of the AT commands AT+WS46 and AT::WS46, getting information about the wireless network selection and the LTE camped IoT preference, respectively. This function in synchronous, and a M2MB_NET_SELECTED_WIRELESS_NETWORK_RESP_T structure is populated with the response.

Parameters
[in]hthe handle to the NET service.
[out]resppointer where to store the response.
Returns
M2MB_RESULT_SUCCESS when the function succeeds.
M2MB_RESULT_INVALID_ARG if resp is NULL.
M2MB_RESULT_FAIL if the function fails.

◆ m2mb_net_init()

M2MB_RESULT_E m2mb_net_init ( M2MB_NET_HANDLE *  h,
m2mb_net_ind_callback  callback,
void *  userdata 
)

m2mb_net_init initializes NET service for current client.

m2mb_net_init initialize NET service for current client returning the handle that must be passed as first parameter for all NET actions. Calling the m2mb_net_init is mandatory before using the NET service.

Parameters
[in]*hIt is the handle to the NET service, that will be initialized by the function.
[in]callbackIt is the callback that will be called if an event or a response happens.
[in]userdataIt is a pointer to generic user data that will be returned as it is in the callback.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_net_init(&h, myCallback, myUserdata);

void myCallback(M2MB_NET_HANDLE h, M2MB_NET_IND_E net_event, UINT16 resp_size, void *resp_struct, void *myUserdata)
{
//my code
}
int main()
{
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_NET_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_net_init(&h, myCallback, (void*)myUserdata);
if ( retVal == M2MB_RESULT_SUCCESS )
printf( "m2mb_net_init succeeded");
}

◆ m2mb_net_set_edrx_info()

M2MB_RESULT_E m2mb_net_set_edrx_info ( M2MB_NET_HANDLE  h,
M2MB_NET_ACC_TECH_TYPE_E  acc_tech,
UINT8  edrx,
UINT8  enabled 
)

m2mb_net_set_edrx_info sets information about edrx.

m2mb_net_set_edrx_info sets information about edrx. The function is asynchronous. This means that the function returns immediately, but the signal information is received in the callback previously set by the m2mb_net_init function. The response event received in the callback will be the M2MB_NET_SET_EDRX_RESP. The resp_struct must be casted to the M2MB_NET_GENERIC_RESP_T type.

Parameters
[in]hIt is the handle to the NET service, previously initialized by the m2mb_net_init function.
[in]acc_techaccess technology to set eDRX.
[in]edrxthe edrx to set.
[in]enabledto enable the edrx.
Returns
returns M2MB_RESULT_SUCCESS on success, a different value on error.
Note

m2mb_net_set_edrx_info(h);

void myCallback(M2MB_NET_HANDLE h, M2MB_NET_IND_E net_event, UINT16 resp_size, void *resp_struct, void *myUserdata)
{
switch(net_event)
{
//...
case M2MB_NET_SET_EDRX_INFO_RESP:
{
printf("SET NET edrx resp is %d, %d", resp->err, resp->response);
}
//...
}
}
int main()
{
UINT8 edrx = 0;
UINT8 enable = 1;
M2MB_RESULT_E retVal = M2MB_RESULT_SUCCESS;
M2MB_NET_HANDLE h;
struct myStruct myUserdata;
retVal = m2mb_net_init(&h, myCallback, (void*)myUserdata);
//...
retVal = m2mb_net_set_edrx_info(h, M2MB_NET_ACC_TECH_TYPE_LTE, edrx, enable);
if ( retVal == M2MB_RESULT_SUCCESS )
printf( "m2mb_net_set_edrx_info request succeeded");
}
m2mb_net_get_current_operator_info
M2MB_RESULT_E m2mb_net_get_current_operator_info(M2MB_NET_HANDLE h)
m2mb_net_get_current_operator_info gets information about current operator.
m2mb_net_set_edrx_info
M2MB_RESULT_E m2mb_net_set_edrx_info(M2MB_NET_HANDLE h, M2MB_NET_ACC_TECH_TYPE_E acc_tech, UINT8 edrx, UINT8 enabled)
m2mb_net_set_edrx_info sets information about edrx.
m2mb_net_get_signal_info
M2MB_RESULT_E m2mb_net_get_signal_info(M2MB_NET_HANDLE h)
m2mb_net_get_signal_info gets information about signal strength.
m2mb_net_get_available_nw_list
M2MB_RESULT_E m2mb_net_get_available_nw_list(M2MB_NET_HANDLE h)
m2mb_net_get_available_nw_list gets a list containing current availble networks.
M2MB_NET_CELL_EUTRAN_U
Definition: m2mb_net.h:326
M2MB_NET_GET_CURRENT_OPERATOR_INFO_RESP_T
Definition: m2mb_net.h:350
M2MB_NET_REG_STATUS_T
Definition: m2mb_net.h:184
M2MB_NET_GET_SIGNAL_INFO_RESP_T
Definition: m2mb_net.h:214
m2mb_net_init
M2MB_RESULT_E m2mb_net_init(M2MB_NET_HANDLE *h, m2mb_net_ind_callback callback, void *userdata)
m2mb_net_init initializes NET service for current client.
M2MB_NET_SIGNAL_INFO_EUTRAN_T
Definition: m2mb_net.h:207
M2MB_NET_CELL_UTRAN_U
Definition: m2mb_net.h:294
M2MB_NET_GENERIC_RESP_T
Definition: m2mb_net.h:178
M2MB_NET_GET_EDRX_INFO_RESP_T
Definition: m2mb_net.h:194
m2mb_net_get_current_cell_list
M2MB_RESULT_E m2mb_net_get_current_cell_list(M2MB_NET_HANDLE h)
m2mb_net_get_current_cell_list gets a list containing current cell neighbors.
M2MB_NET_GET_CURRENT_CELL_LIST_RESP_T
Definition: m2mb_net.h:343
m2mb_net_enable_ind
M2MB_RESULT_E m2mb_net_enable_ind(M2MB_NET_HANDLE h, M2MB_NET_IND_E ind, UINT8 enable)
m2mb_net_enable_ind enables the indications of network state change events.
M2MB_NET_CELL_NEIGHBOR_T
Definition: m2mb_net.h:332
M2MB_NET_DESCRIPTION_T
Definition: m2mb_net.h:358
M2MB_NET_GET_AVAILABLE_NW_LIST_RESP_T
Definition: m2mb_net.h:367
m2mb_net_get_reg_status_info
M2MB_RESULT_E m2mb_net_get_reg_status_info(M2MB_NET_HANDLE h)
m2mb_net_get_reg_status_info gets information about regitration status.
M2MB_NET_GET_BER_RESP_T
Definition: m2mb_net.h:223
M2MB_NET_SIGNAL_INFO_UTRAN_T
Definition: m2mb_net.h:202
m2mb_net_get_ber
M2MB_RESULT_E m2mb_net_get_ber(M2MB_NET_HANDLE h)
m2mb_net_get_ber gets information about bit error rate.
m2mb_net_get_edrx_info
M2MB_RESULT_E m2mb_net_get_edrx_info(M2MB_NET_HANDLE h, M2MB_NET_ACC_TECH_TYPE_E acc_tech)
m2mb_net_get_edrx_info gets information about edrx.
M2MB_NET_CELL_GERAN_U
Definition: m2mb_net.h:266
m2mb_net_deinit
M2MB_RESULT_E m2mb_net_deinit(M2MB_NET_HANDLE h)
m2mb_net_deinit deinitializes NET service for current client.