Syntax
VM_RESULT vm_gsm_sms_add_message(
    vm_gsm_sms_add_message_t* message_data, 
    vm_gsm_sms_callback callback, 
    void* user_data
);
ContentsIndex
PreviousUpNext
vm_gsm_sms_add_message
Example
Syntax
VM_RESULT vm_gsm_sms_add_message(
    vm_gsm_sms_add_message_t* message_data, 
    vm_gsm_sms_callback callback, 
    void* user_data
);
Description

Saves a new message to SMS Storage. If the caller specifies those parameters (Status, Address, Content, SIM Card, Storage Type, Profile element), they will be used. Otherwise, it will use the default values (If the parameters are in the SMS setting, it will use them as default). The Callback Action Data Struct is vm_gsm_sms_save_message_callback_t.

Parameters
Parameters 
Description 
vm_gsm_sms_add_message_t* message_data 
[IN] Message data to be added. 
vm_gsm_sms_callback callback 
[IN] Callback function. 
void* user_data 
[IN] User data. 
Returns

Refer to VM_GSM_SMS_RESULT for return result and error code.

Example
void custom_sms_add_message_callback(vm_gsm_sms_callback_t* callback_data)
{
    vm_gsm_sms_save_message_callback_t* add_message;
    if(callback_data->action == VM_GSM_SMS_ACTION_SAVE)
    {
        if(callback_data->cause == VM_GSM_SMS_CAUSE_NO_ERROR)
        {
            if(!callback_data->action_data)
            {
                 vm_log_debug("action_data is NULL.");
                 return;
            }
            add_message = (vm_gsm_sms_save_message_callback_t*)callback_data->action_data;
            vm_log_debug("add message callback message cause=%d, result=%d, message_id = %d",
                         callback_data->cause, callback_data->result, add_message->message_id);
        }
        else
        {
            vm_log_debug("add message failed.");
        }
    }
}

void cutomer_sms_add_message(void)
{
    VMINT res;
    VMWCHAR content[100];
    vm_gsm_sms_add_message_t message_data;

    vm_ascii_to_ucs2(content, 100*2, "what is this,draft");
    vm_ascii_to_ucs2(message_data.number, 21*2, "10086");
    message_data.content = content;
    message_data.content_size = vm_wstrlen(content);
    res = vm_gsm_sms_add_message(&message_data, custom_sms_add_message_callback, NULL);
    if(res != VM_GSM_SMS_RESULT_OK)
    {
        vm_log_debug(" cutomer_sms_add_message failed to save.");
    }
}
File

vmgsm_sms.h

Group
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.