Go to the source code of this file.
|
typedef int | anjay_smsdrv_recv_all_cb_t(void *cb_arg, const char *source, const void *data, uint8_t data_size, const anjay_smsdrv_multipart_info_t *multipart_info, bool *out_should_remove) |
|
typedef int | anjay_smsdrv_send_t(anjay_smsdrv_t *driver, const char *destination, const void *data, size_t data_size, const anjay_smsdrv_multipart_info_t *multipart_info, avs_time_duration_t timeout) |
|
typedef int | anjay_smsdrv_should_try_recv_t(anjay_smsdrv_t *driver, avs_time_duration_t timeout) |
|
typedef int | anjay_smsdrv_recv_all_t(anjay_smsdrv_t *driver, anjay_smsdrv_recv_all_cb_t *cb, void *cb_arg) |
|
typedef int | anjay_smsdrv_system_socket_t(anjay_smsdrv_t *driver, const void **out) |
|
typedef avs_errno_t | anjay_smsdrv_error_t(anjay_smsdrv_t *driver) |
|
typedef void | anjay_smsdrv_free_t(anjay_smsdrv_t *driver) |
|
◆ ANJAY_MSISDN_SIZE
#define ANJAY_MSISDN_SIZE 16 |
◆ anjay_smsdrv_error_t
If the last other method invoked on the driver returned an error, returns an errno-compatible code with its actual cause.
NOTE: AVS_ENODEV
is reserved for signalling a loss-of-carrier condition that shall NOT be treated as fatal. For this one special error code, errors while handling incoming requests will NOT trigger connection closure (and subsequent retry and/or rebootstrap attempts) as all other errors will.
- Parameters
-
driver | SMS driver object to operate on. |
- Returns
- errno-compatible error code.
◆ anjay_smsdrv_free_t
Cleanups the device driver, freeing all used resources.
- Parameters
-
driver | Device driver context to operate on. |
◆ anjay_smsdrv_recv_all_cb_t
typedef int anjay_smsdrv_recv_all_cb_t(void *cb_arg, const char *source, const void *data, uint8_t data_size, const anjay_smsdrv_multipart_info_t *multipart_info, bool *out_should_remove) |
◆ anjay_smsdrv_recv_all_t
Examines the SMS inbox.
Note that all entries which are not in 8-bit format or cannot be handled for any other reason, are ignored.
- Parameters
-
driver | SMS driver object to operate on. |
cb | Function to invoke for all 8-bit SMS messages present in the inbox. If the callback sets its out_should_remove variable to true, the message is removed from the inbox. |
cb_arg | User data value to be passed on to the cb function. |
◆ anjay_smsdrv_send_t
Sends an SMS message in 8-bit mode.
- Parameters
-
driver | SMS driver object to operate on. |
destination | Phone number of the destination in plain ASCII format (either international using "+", or national). |
data | Pointer to SMS payload data to send. |
data_size | Length of SMS payload data to send. |
multipart_info | Reference information for a Concatenated SMS part, or NULL if the SMS being sent is not part of a Concatenated SMS message. |
timeout | Duration of time after which to give up waiting for a response from the modem. |
- Returns
- Zero for success, or a negative value in case of error.
◆ anjay_smsdrv_should_try_recv_t
typedef int anjay_smsdrv_should_try_recv_t(anjay_smsdrv_t *driver, avs_time_duration_t timeout) |
Waits for new messages in the inbox. Checks whether any new messages came since last call to anjay_smsdrv_recv_all_cb_t, and if not - waits for notification about new message to come before the specified timeout.
- Parameters
-
driver | SMS driver object to operate on. |
timeout | Duration of time after which to give up waiting for notification. |
- Returns
- 1 if there are new messages in the inbox, 0 if none came before timeout, or a negative value in case of error.
◆ anjay_smsdrv_system_socket_t
typedef int anjay_smsdrv_system_socket_t(anjay_smsdrv_t *driver, const void **out) |
Returns a pointer to bare system handle to the modem port (e.g. to invoke select
or poll
). The returned handle shall be interpreted in the same way as the value returned from avs_net_socket_get_system()
.
- Parameters
-
driver | SMS driver object to operate on. |
out | Pointer to a variable in which to save the pointer to the system handle. |
- Returns
- Zero for success, or a negative value in case of error.
◆ anjay_smsdrv_cleanup()
Cleans up all resources and releases an SMS driver object, using user provided implementation of anjay_smsdrv_free_t .
Sets *driver to NULL afterwards.
NOTE: If an Anjay object has been using the SMS driver, the SMS driver shall be cleaned up after freeing the Anjay object using anjay_delete.
- Parameters
-
driver | Pointer to an SMS driver object to delete. |