Network

group LWGSM_NETWORK

Network manager.

Enums

enum lwgsm_network_reg_status_t

Network Registration status.

Values:

enumerator LWGSM_NETWORK_REG_STATUS_SIM_ERR

SIM card error

enumerator LWGSM_NETWORK_REG_STATUS_CONNECTED

Device is connected to network

enumerator LWGSM_NETWORK_REG_STATUS_SEARCHING

Network search is in progress

enumerator LWGSM_NETWORK_REG_STATUS_DENIED

Registration denied

enumerator LWGSM_NETWORK_REG_STATUS_CONNECTED_ROAMING

Device is connected and is roaming

enumerator LWGSM_NETWORK_REG_STATUS_CONNECTED_SMS_ONLY

Device is connected to home network in SMS-only mode

enumerator LWGSM_NETWORK_REG_STATUS_CONNECTED_ROAMING_SMS_ONLY

Device is roaming in SMS-only mode

Functions

lwgsmr_t lwgsm_network_rssi(int16_t *rssi, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)

Read RSSI signal from network operator.

Return

lwgsmOK on success, member of lwgsmr_t enumeration otherwise

Parameters
  • [out] rssi: RSSI output variable. When set to 0, RSSI is not valid

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

  • [in] evt_arg: Custom argument for event callback function

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

lwgsm_network_reg_status_t lwgsm_network_get_reg_status(void)

Get network registration status.

Return

Member of lwgsm_network_reg_status_t enumeration

lwgsmr_t lwgsm_network_attach(const char *apn, const char *user, const char *pass, const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)

Attach to network and active PDP context.

Return

lwgsmOK on success, member of lwgsmr_t enumeration otherwise

Parameters
  • [in] apn: APN name

  • [in] user: User name to attach. Set to NULL if not used

  • [in] pass: User password to attach. Set to NULL if not used

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

  • [in] evt_arg: Custom argument for event callback function

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

lwgsmr_t lwgsm_network_detach(const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)

Detach from network.

Return

lwgsmOK on success, member of lwgsmr_t enumeration otherwise

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

  • [in] evt_arg: Custom argument for event callback function

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

uint8_t lwgsm_network_is_attached(void)

Check if device is attached to network and PDP context is active.

Return

1 on success, 0 otherwise

lwgsmr_t lwgsm_network_copy_ip(lwgsm_ip_t *ip)

Copy IP address from internal value to user variable.

Return

lwgsmOK on success, member of lwgsmr_t enumeration otherwise

Parameters
  • [out] ip: Pointer to output IP variable

lwgsmr_t lwgsm_network_check_status(const lwgsm_api_cmd_evt_fn evt_fn, void *const evt_arg, const uint32_t blocking)

Check network PDP status.

Return

lwgsmOK on success, member of lwgsmr_t enumeration otherwise

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

  • [in] evt_arg: Custom argument for event callback function

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