Network operator

group LWGSM_OPERATOR

network operator API

Enums

enum lwgsm_operator_status_t

Operator status value.

Values:

enumerator LWGSM_OPERATOR_STATUS_UNKNOWN = 0x00

Unknown operator

enumerator LWGSM_OPERATOR_STATUS_AVAILABLE

Operator is available

enumerator LWGSM_OPERATOR_STATUS_CURRENT

Operator is currently active

enumerator LWGSM_OPERATOR_STATUS_FORBIDDEN

Operator is forbidden

enum lwgsm_operator_mode_t

Operator selection mode.

Values:

enumerator LWGSM_OPERATOR_MODE_AUTO = 0x00

Operator automatic mode

enumerator LWGSM_OPERATOR_MODE_MANUAL = 0x01

Operator manual mode

enumerator LWGSM_OPERATOR_MODE_DEREGISTER = 0x02

Operator deregistered from network

enumerator LWGSM_OPERATOR_MODE_MANUAL_AUTO = 0x04

Operator manual mode first. If fails, auto mode enabled

enum lwgsm_operator_format_t

Operator data format.

Values:

enumerator LWGSM_OPERATOR_FORMAT_LONG_NAME = 0x00

COPS command returned long name

enumerator LWGSM_OPERATOR_FORMAT_SHORT_NAME

COPS command returned short name

enumerator LWGSM_OPERATOR_FORMAT_NUMBER

COPS command returned number

enumerator LWGSM_OPERATOR_FORMAT_INVALID

Unknown format

Functions

lwgsmr_t lwgsm_operator_get(lwgsm_operator_curr_t *curr, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)

Get current operator.

Parameters
  • curr[out] Pointer to output variable to save info about current operator

  • evt_fn[in] Callback function called when command has finished. Set to NULL when not used

  • evt_arg[in] Custom argument for event callback function

  • blocking[in] Status whether command should be blocking or not

Returns

lwgsmOK on success, member of lwgsmr_t enumeration otherwise

lwgsmr_t lwgsm_operator_set(lwgsm_operator_mode_t mode, lwgsm_operator_format_t format, const char *name, uint32_t num, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)

Set current operator.

Parameters
  • mode[in] Operator mode. This parameter can be a value of lwgsm_operator_mode_t enumeration

  • format[in] Operator data format. This parameter can be a value of lwgsm_operator_format_t enumeration

  • name[in] Operator name. This parameter must be valid according to format parameter

  • num[in] Operator number. This parameter must be valid according to format parameter

  • evt_fn[in] Callback function called when command has finished. Set to NULL when not used

  • evt_arg[in] Custom argument for event callback function

  • blocking[in] Status whether command should be blocking or not

Returns

lwgsmOK on success, member of lwgsmr_t enumeration otherwise

lwgsmr_t lwgsm_operator_scan(lwgsm_operator_t *ops, size_t opsl, size_t *opf, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)

Scan for available operators.

Parameters
  • ops[in] Pointer to array to write found operators

  • opsl[in] Length of input array in units of elements

  • opf[out] Pointer to ouput variable to save number of operators found

  • evt_fn[in] Callback function called when command has finished. Set to NULL when not used

  • evt_arg[in] Custom argument for event callback function

  • blocking[in] Status whether command should be blocking or not

Returns

lwgsmOK on success, member of lwgsmr_t enumeration otherwise

struct lwgsm_operator_t
#include <lwgsm_types.h>

Operator details for scan.

Public Members

lwgsm_operator_status_t stat

Operator status

char long_name[20]

Operator long name

char short_name[20]

Operator short name

uint32_t num

Operator numeric value

struct lwgsm_operator_curr_t
#include <lwgsm_types.h>

Current operator info.

Public Members

lwgsm_operator_mode_t mode

Operator mode

lwgsm_operator_format_t format

Data format

char long_name[20]

Long name format

char short_name[20]

Short name format

uint32_t num

Number format

union lwgsm_operator_curr_t::[anonymous] data

Operator data union