![]() |
m2mb API docs
30.00.007
m2mb API sets documentation
|
Header file for m2mb_sms APIs. More...
Go to the source code of this file.
Data Structures | |
struct | M2MB_SMS_ERR_CAUSE_T |
struct | M2MB_SMS_READ_RESP_T |
struct | M2MB_SMS_WRITE_RESP_T |
struct | M2MB_SMS_SEND_RESP_T |
struct | M2MB_SMS_ACK_RESP_T |
struct | M2MB_SMS_GET_SCA_RESP_T |
struct | M2MB_SMS_GET_STORAGE_STAT_RESP_T |
struct | M2MB_SMS_GET_STORAGE_INDEXES_RESP_T |
struct | M2MB_SMS_GENERIC_RESP_T |
struct | M2MB_SMS_INCOMING_T |
struct | M2MB_SMS_MEMORY_FULL_T |
Macros | |
#define | M2MB_SMS_PDU_LENGTH_MAX 255 |
#define | M2MB_SMS_STORAGE_INDEXES_MAX 255 |
#define | M2MB_SMS_ADDRESS_TYPE_MAX 3 |
#define | M2MB_SMS_SCA_DIGIT_MAX 21 |
Typedefs | |
typedef HANDLE | M2MB_SMS_HANDLE |
typedef void(* | m2mb_sms_ind_callback) (M2MB_SMS_HANDLE h, M2MB_SMS_IND_E sms_event, UINT16 resp_size, void *resp_struct, void *userdata) |
Functions | |
M2MB_RESULT_E | m2mb_sms_init (M2MB_SMS_HANDLE *h, m2mb_sms_ind_callback callback, void *userdata) |
m2mb_sms_init initializes SMS service for current client. More... | |
M2MB_RESULT_E | m2mb_sms_deinit (M2MB_SMS_HANDLE h) |
m2mb_sms_deinit deinitializes SMS service for current client. More... | |
M2MB_RESULT_E | m2mb_sms_conf (M2MB_SMS_HANDLE h, UINT8 argc,...) |
m2mb_sms_conf sets/gets some SMS parameters. More... | |
M2MB_RESULT_E | m2mb_sms_enable_ind (M2MB_SMS_HANDLE h, M2MB_SMS_IND_E ind, UINT8 enable) |
m2mb_sms_enable_ind enables SMS events. More... | |
M2MB_RESULT_E | m2mb_sms_send (M2MB_SMS_HANDLE h, UINT32 pdu_len, UINT8 *pdu) |
m2mb_sms_send sends a SMS PDU. More... | |
M2MB_RESULT_E | m2mb_sms_write (M2MB_SMS_HANDLE h, UINT32 pdu_len, UINT8 *pdu) |
m2mb_sms_write writes a SMS PDU into the current memory. More... | |
M2MB_RESULT_E | m2mb_sms_send_from_mem (M2MB_SMS_HANDLE h, UINT32 index) |
m2mb_sms_send_from_mem sends a SMS PDU from the current memory. More... | |
M2MB_RESULT_E | m2mb_sms_ack (M2MB_SMS_HANDLE h, M2MB_SMS_ACK_RES_E res, UINT32 transactionID, UINT32 failureCause1, UINT32 failureCause2) |
m2mb_sms_ack acknowledge an incoming SMS. More... | |
M2MB_RESULT_E | m2mb_sms_read (M2MB_SMS_HANDLE h, UINT32 index) |
m2mb_sms_read reads a SMS PDU from the current memory. More... | |
M2MB_RESULT_E | m2mb_sms_delete (M2MB_SMS_HANDLE h, UINT32 index) |
m2mb_sms_delete deletes a SMS PDU from the current memory. More... | |
M2MB_RESULT_E | m2mb_sms_set_tag (M2MB_SMS_HANDLE h, UINT32 index, M2MB_SMS_TAG_E tag) |
m2mb_sms_set_tag changes the tag of a SMS PDU in the current memory. More... | |
M2MB_RESULT_E | m2mb_sms_set_sca (M2MB_SMS_HANDLE h, UINT8 *sca) |
m2mb_sms_set_sca sets the Service Center Address. More... | |
M2MB_RESULT_E | m2mb_sms_get_sca (M2MB_SMS_HANDLE h) |
m2mb_sms_get_sca gets current Service Center Address. More... | |
M2MB_RESULT_E | m2mb_sms_set_route (M2MB_SMS_HANDLE h, M2MB_SMS_CLASS_E smClass, M2MB_SMS_STORAGE_E stType, M2MB_SMS_INC_ACTION_E stAct) |
m2mb_sms_set_route manages the behaviour of incoming SMS. More... | |
M2MB_RESULT_E | m2mb_sms_get_route (M2MB_SMS_HANDLE h, M2MB_SMS_CLASS_E smClass, M2MB_SMS_STORAGE_E *stType, M2MB_SMS_INC_ACTION_E *stAct) |
m2mb_sms_get_route gets the current behaviour of a specific SMS class. More... | |
M2MB_RESULT_E | m2mb_sms_set_storage (M2MB_SMS_HANDLE h, M2MB_SMS_STORAGE_E stType) |
m2mb_sms_set_storage sets the current storage for SMSs. More... | |
M2MB_RESULT_E | m2mb_sms_get_storage_stat (M2MB_SMS_HANDLE h) |
m2mb_sms_get_storage_stat gets the status of current storage. More... | |
M2MB_RESULT_E | m2mb_sms_get_storage_indexes (M2MB_SMS_HANDLE h, M2MB_SMS_TAG_E tag) |
m2mb_sms_get_storage_indexes gets the index list of stored SMSs. More... | |
Header file for m2mb_sms APIs.
m2m/m2m_common/m2mb_inc/m2mb_sms.h
m2mb_sms APIs provide actions and events for SMS management.
@notes
M2MB_RESULT_E m2mb_sms_ack | ( | M2MB_SMS_HANDLE | h, |
M2MB_SMS_ACK_RES_E | res, | ||
UINT32 | transactionID, | ||
UINT32 | failureCause1, | ||
UINT32 | failureCause2 | ||
) |
m2mb_sms_ack acknowledge an incoming SMS.
m2mb_sms_ack acknowledge an incoming SMS, if the option M2MB_SMS_FORWARD_ONLY is set (see m2mb_sms_set_route and m2mb_sms_get_route functions). The function is asynchronous. This means that the function returns immediately, but the result of the SMS ack is received in the callback previously set by the m2mb_sms_init function. The response event received in the callback will be the M2MB_SMS_ACK_RESP. The resp_struct must be casted to the M2MB_SMS_ACK_RESP_T type.
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | res | second parameter is the ack or nack to the incoming SMS. |
[in] | transactionID | third parameter is the transaction ID given in the M2MB_SMS_INCOMING_T structure. |
[in] | failureCause1 | fourth parameter value has the following meaning (only if "res" is M2MB_SMS_ACK_FAIL):
|
[in] | failureCause2 | fifth parameter value has the following meaning (only if "res" is M2MB_SMS_ACK_FAIL):
|
m2mb_sms_ack(h, res, transactionID, failureCause1, failureCause2);
M2MB_RESULT_E m2mb_sms_conf | ( | M2MB_SMS_HANDLE | h, |
UINT8 | argc, | ||
... | |||
) |
m2mb_sms_conf sets/gets some SMS parameters.
m2mb_sms_conf sets/gets SMS parameters listed in the M2MB_SMS_ACTION_E enum.
[in] | h | Handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | argc | It determines the number of parameters that follows, plus one (e.g.: if two parameters follow, argc is 3) |
[in] | It | determines the action (among the ones listed in M2MB_SMS_ACTION_E), while the parameters that follow depend on the action (see following note for further details) |
Description: set the format (3GPP or 3GPP2) used to send, ack and write the SMS. Default is 3GPP.
Params(in): h(M2MB_SMS_HANDLE), action(M2MB_SMS_ACTION_E), format(M2MB_SMS_FORMAT_E)
m2mb_sms_conf(h, 3, M2MB_SMS_SET_FORMAT, M2MB_SMS_FORMAT_3GPP);
Action: M2MB_SMS_GET_FORMAT
Description: get the current SMS format used to send, ack and write the SMS.
Params(in): h(M2MB_SMS_HANDLE), action(M2MB_SMS_ACTION_E), format(M2MB_SMS_FORMAT_E*)
M2MB_SMS_FORMAT_E currentFormat; m2mb_sms_conf(h, 3, M2MB_SMS_GET_FORMAT, ¤tFormat);
Action: M2MB_SMS_SET_IMS_EN
Description: set the mode used to send the SMS (over CS or over IMS). Default is "over CS".
Params(in): h(M2MB_SMS_HANDLE), action(M2MB_SMS_ACTION_E), format(M2MB_SMS_IMS_E)
m2mb_sms_conf(h, 3, M2MB_SMS_SET_IMS_EN, M2MB_SMS_OVER_CS);
Action: M2MB_SMS_GET_IMS_EN
Description: get the current mode used to send the SMS (over CS or over IMS).
Params(in): h(M2MB_SMS_HANDLE), action(M2MB_SMS_ACTION_E), format(M2MB_SMS_IMS_E*)
M2MB_SMS_IMS_E currentMode; m2mb_sms_conf(h, 3, M2MB_SMS_GET_IMS_EN, ¤tMode);
Action: M2MB_SMS_SET_WRITE_TAG
Description: set the tag used when a SMS is written through m2mb_sms_write funcion. Default is "not sent".
Params(in): h(M2MB_SMS_HANDLE), action(M2MB_SMS_ACTION_E), format(M2MB_SMS_TAG_E)
m2mb_sms_conf(h, 3, M2MB_SMS_SET_WRITE_TAG, M2MB_SMS_TAG_MO_NOT_SENT);
Action: M2MB_SMS_GET_WRITE_TAG
Description: get the current m2mb_sms_write tag.
Params(in): h(M2MB_SMS_HANDLE), action(M2MB_SMS_ACTION_E), format(M2MB_SMS_TAG_E*)
M2MB_SMS_TAG_E currentTag; m2mb_sms_conf(h, 3, M2MB_SMS_GET_WRITE_TAG, ¤tTag);
Action: M2MB_SMS_SET_MORE_MSG_TO_SEND
Description: enable/disable the "more message to send" functionality. Default is "disabled". The "more message to send" functionality controls the continuity of SMS relay protocol link. When feature is enabled (and supported by network) multiple messages can be sent much faster as link is kept open. If the time between the response of the latest message send command and the next send command exceeds 5 seconds, the link is closed but the functionality remains enabled.
Params(in): h(M2MB_SMS_HANDLE), action(M2MB_SMS_ACTION_E), format(M2MB_SMS_MMTS_E)
m2mb_sms_conf(h, 3, M2MB_SMS_SET_MORE_MSG_TO_SEND, M2MB_SMS_MMTS_DISABLED);
Action: M2MB_SMS_GET_MORE_MSG_TO_SEND
Description: get the current status of "more message to send" functionality.
Params(in): h(M2MB_SMS_HANDLE), action(M2MB_SMS_ACTION_E), format(M2MB_SMS_MMTS_E*)
M2MB_SMS_MMTS_E currentMmts; m2mb_sms_conf(h, 3, M2MB_SMS_GET_MORE_MSG_TO_SEND, ¤tMmts);
M2MB_RESULT_E m2mb_sms_deinit | ( | M2MB_SMS_HANDLE | h | ) |
m2mb_sms_deinit deinitializes SMS service for current client.
m2mb_sms_deinit deinitialize SMS service for current client freeing the handle passed as first parameter. Calling the m2mb_sms_deinit is useful after using the SMS service in order to free memory space.
[in] | h | first parameter is the handle to the SMS service, that will be deinitialized by the function. |
m2mb_sms_deinit(&h);
M2MB_RESULT_E m2mb_sms_delete | ( | M2MB_SMS_HANDLE | h, |
UINT32 | index | ||
) |
m2mb_sms_delete deletes a SMS PDU from the current memory.
m2mb_sms_delete deletes a SMS PDU stored in the current memory (see m2mb_sms_set_storage, m2mb_sms_write, m2mb_sms_set_route and m2mb_sms_get_route functions). The function is asynchronous. This means that the function returns immediately, but the result of the SMS deletion is received in the callback previously set by the m2mb_sms_init function. The response event received in the callback will be the M2MB_SMS_DELETE_RESP. The resp_struct must be casted to the M2MB_SMS_GENERIC_RESP_T type.
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | ind | second parameter is the index where the SMS is stored in the current memory. |
m2mb_sms_delete(h, index);
M2MB_RESULT_E m2mb_sms_enable_ind | ( | M2MB_SMS_HANDLE | h, |
M2MB_SMS_IND_E | ind, | ||
UINT8 | enable | ||
) |
m2mb_sms_enable_ind enables SMS events.
m2mb_sms_enable_ind enables the signaling of SMS events through the callback function previously registerd with the m2mb_sms_init.
[in] | h | Handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | ind | Determines the event (among the ones ending with the _IND suffix, listed in M2MB_SMS_IND_E) to be enabled/disabled. |
[in] | enable | Integer to enable/disable the event "ind" (0 to disable or 1 to enable). |
m2mb_sms_enable_ind(h, M2MB_SMS_INCOMING_IND, 1);
M2MB_RESULT_E m2mb_sms_get_route | ( | M2MB_SMS_HANDLE | h, |
M2MB_SMS_CLASS_E | smClass, | ||
M2MB_SMS_STORAGE_E * | stType, | ||
M2MB_SMS_INC_ACTION_E * | stAct | ||
) |
m2mb_sms_get_route gets the current behaviour of a specific SMS class.
m2mb_sms_get_route gets the current behaviour of incoming SMS per specific SMS class.
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | smClass | second parameter is the SMS class for which the current setting is done. |
[in] | *stType | third parameter is the current storage type where incoming SMSs with class "smClass" are stored. |
[in] | *stAct | fourth parameter is the current action that is performed for all the SMS with class "smClass". |
m2mb_sms_get_route(h, smClass, &stType, &stAct);
M2MB_RESULT_E m2mb_sms_get_sca | ( | M2MB_SMS_HANDLE | h | ) |
m2mb_sms_get_sca gets current Service Center Address.
m2mb_sms_get_sca gets current Service Center Address read from the xSIM. The function is asynchronous. This means that the function returns immediately, but the Service Center Address value is received in the callback previously set by the m2mb_sms_init function. The response event received in the callback will be the M2MB_SMS_GET_SCA_RESP. The resp_struct must be casted to the M2MB_SMS_GET_SCA_RESP_T type.
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
m2mb_sms_get_sca(h);
M2MB_RESULT_E m2mb_sms_get_storage_indexes | ( | M2MB_SMS_HANDLE | h, |
M2MB_SMS_TAG_E | tag | ||
) |
m2mb_sms_get_storage_indexes gets the index list of stored SMSs.
m2mb_sms_get_storage_indexes gets current storage and the index list of SMS currently stored into it, having a certain tag (see M2MB_SMS_TAG_E enum). The function is asynchronous. This means that the function returns immediately, but the storage indexes are received in the callback previously set by the m2mb_sms_init function. The response event received in the callback will be the M2MB_SMS_GET_STORAGE_INDEXES_RESP. The resp_struct must be casted to the M2MB_SMS_GET_STORAGE_INDEXES_RESP_T type.
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | tag | second parameter is the tag of SMS that will be included in the returned index list. |
m2mb_sms_get_storage_indexes(h, tag);
M2MB_RESULT_E m2mb_sms_get_storage_stat | ( | M2MB_SMS_HANDLE | h | ) |
m2mb_sms_get_storage_stat gets the status of current storage.
m2mb_sms_get_storage_stat gets current storage and its status (total amount of space and number of SMS currently stored). The function is asynchronous. This means that the function returns immediately, but the storage status is received in the callback previously set by the m2mb_sms_init function. The response event received in the callback will be the M2MB_SMS_GET_STORAGE_STAT_RESP. The resp_struct must be casted to the M2MB_SMS_GET_STORAGE_STAT_RESP_T type.
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
m2mb_sms_get_storage_stat(h);
M2MB_RESULT_E m2mb_sms_init | ( | M2MB_SMS_HANDLE * | h, |
m2mb_sms_ind_callback | callback, | ||
void * | userdata | ||
) |
m2mb_sms_init initializes SMS service for current client.
m2mb_sms_init initialize SMS service for current client returning the handle that must be passed as first parameter for all SMS actions. Calling the m2mb_sms_init is mandatory before using the SMS service.
[in] | *h | first parameter is the handle to the SMS service, that will be initialized by the function. |
[in] | callback | second parameter is the callback that will be called if an event or a response happens. |
[in] | userdata | third parameter is a pointer to generic user data that will be returned as it is in the callback. |
m2mb_sms_init(&h, myCallback, myUserdata);
M2MB_RESULT_E m2mb_sms_read | ( | M2MB_SMS_HANDLE | h, |
UINT32 | index | ||
) |
m2mb_sms_read reads a SMS PDU from the current memory.
m2mb_sms_read reads a SMS PDU stored in the current memory (see m2mb_sms_set_storage, m2mb_sms_write, m2mb_sms_set_route and m2mb_sms_get_route functions). The function is asynchronous. This means that the function returns immediately, but the result of the SMS reading is received in the callback previously set by the m2mb_sms_init function. The response event received in the callback will be the M2MB_SMS_READ_RESP. The resp_struct must be casted to the M2MB_SMS_READ_RESP_T type.
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | ind | second parameter is the index where the SMS is stored in the current memory. |
m2mb_sms_read(h, index);
M2MB_RESULT_E m2mb_sms_send | ( | M2MB_SMS_HANDLE | h, |
UINT32 | pdu_len, | ||
UINT8 * | pdu | ||
) |
m2mb_sms_send sends a SMS PDU.
m2mb_sms_send sends a SMS PDU to the network. The function is asynchronous. This means that the function returns immediately, but the confirmation of the SMS shipment is received in the callback previously set by the m2mb_sms_init function. The response event received in the callback will be the M2MB_SMS_SEND_RESP. The resp_struct must be casted to the M2MB_SMS_SEND_RESP_T type.
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | ind | second parameter is the PDU length in byte. |
[in] | enable | third parameter is an array containing the PDU to be sent. |
m2mb_sms_send(h, pdu_len, pdu);
M2MB_RESULT_E m2mb_sms_send_from_mem | ( | M2MB_SMS_HANDLE | h, |
UINT32 | index | ||
) |
m2mb_sms_send_from_mem sends a SMS PDU from the current memory.
m2mb_sms_send_from_mem sends a SMS PDU stored in the current memory (see m2mb_sms_set_storage and m2mb_sms_write function). The function is asynchronous. This means that the function returns immediately, but the confirmation of the SMS sending is received in the callback previously set by the m2mb_sms_init function. The response event received in the callback will be the M2MB_SMS_SEND_FROM_MEM_RESP. The resp_struct must be casted to the M2MB_SMS_SEND_RESP_T type.
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | ind | second parameter is the index where the SMS is stored in the current memory. |
m2mb_sms_send_from_mem(h, index);
M2MB_RESULT_E m2mb_sms_set_route | ( | M2MB_SMS_HANDLE | h, |
M2MB_SMS_CLASS_E | smClass, | ||
M2MB_SMS_STORAGE_E | stType, | ||
M2MB_SMS_INC_ACTION_E | stAct | ||
) |
m2mb_sms_set_route manages the behaviour of incoming SMS.
m2mb_sms_set_route sets the way each incoming SMS is managed, depending of its class.
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | smClass | second parameter is the SMS class for which the current setting is done. |
[in] | stType | third parameter indicates the storage type where incoming SMSs with "smClass" class will be stored. |
[in] | stAct | fourth parameter indicates the action that will be performed for all the SMS with class "smClass". |
m2mb_sms_set_route(h, smClass, stType, stAct);
M2MB_RESULT_E m2mb_sms_set_sca | ( | M2MB_SMS_HANDLE | h, |
UINT8 * | sca | ||
) |
m2mb_sms_set_sca sets the Service Center Address.
m2mb_sms_set_sca sets the Service Center Address in the xSIM. The function is asynchronous. This means that the function returns immediately, but the Service Center Address setting is confirmed in the callback previously set by the m2mb_sms_init function. The response event received in the callback will be the M2MB_SMS_SET_SCA_RESP. The resp_struct must be casted to the M2MB_SMS_GENERIC_RESP_T type.
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | sca | second parameter is an array with the Service Center Address to be stored, written in ASCII chars. |
m2mb_sms_set_sca(h, sca);
M2MB_RESULT_E m2mb_sms_set_storage | ( | M2MB_SMS_HANDLE | h, |
M2MB_SMS_STORAGE_E | stType | ||
) |
m2mb_sms_set_storage sets the current storage for SMSs.
m2mb_sms_set_storage sets the current storage used by m2mb_sms_read, m2mb_sms_write, m2mb_sms_delete and m2mb_sms_send_from_mem
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | smClass | second parameter indicates the storage to be set. |
m2mb_sms_set_storage(h, stType);
M2MB_RESULT_E m2mb_sms_set_tag | ( | M2MB_SMS_HANDLE | h, |
UINT32 | index, | ||
M2MB_SMS_TAG_E | tag | ||
) |
m2mb_sms_set_tag changes the tag of a SMS PDU in the current memory.
m2mb_sms_set_tag changes the tag of a SMS PDU in the current memory (see m2mb_sms_set_storage, m2mb_sms_write, m2mb_sms_set_route and m2mb_sms_get_route functions). The function is asynchronous. This means that the function returns immediately, but the result of the SMS deletion is received in the callback previously set by the m2mb_sms_init function. The response event received in the callback will be the M2MB_SMS_SET_TAG_RESP. The resp_struct must be casted to the M2MB_SMS_GENERIC_RESP_T type.
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | ind | second parameter is the index where the SMS is stored in the current memory. |
[in] | tag | third parameter is the tag to be set in the SMS at index ind. |
m2mb_sms_set_tag(h, index, tag);
M2MB_RESULT_E m2mb_sms_write | ( | M2MB_SMS_HANDLE | h, |
UINT32 | pdu_len, | ||
UINT8 * | pdu | ||
) |
m2mb_sms_write writes a SMS PDU into the current memory.
m2mb_sms_write writes a SMS PDU into the current memory (see m2mb_sms_set_storage function). The function is asynchronous. This means that the function returns immediately, but the confirmation of the SMS writing is received in the callback previously set by the m2mb_sms_init function. The response event received in the callback will be the M2MB_SMS_WRITE_RESP. The resp_struct must be casted to the M2MB_SMS_WRITE_RESP_T type.
[in] | h | first parameter is the handle to the SMS service, previously initialized by the m2mb_sms_init function. |
[in] | ind | second parameter is the PDU length in byte. |
[in] | enable | third parameter is an array containing the PDU to be written. |
m2mb_sms_write(h, pdu_len, pdu);