Syntax
VM_RESULT vm_gsm_sms_get_center_address(
    VM_GSM_SMS_SIM sim_id, 
    vm_gsm_sms_callback callback, 
    void* user_data
);
ContentsIndex
PreviousUpNext
vm_gsm_sms_get_center_address
Example
Syntax
VM_RESULT vm_gsm_sms_get_center_address(
    VM_GSM_SMS_SIM sim_id, 
    vm_gsm_sms_callback callback, 
    void* user_data
);
Description

Asynchronously gets center address of the SIM for SMS, which is a phone number.

Parameters
Parameters 
Description 
VM_GSM_SMS_SIM sim_id 
[IN] Specifies the SIM card to get the center address for. 
vm_gsm_sms_callback callback 
[IN] Callback function. 
void* user_data 
[IN] Additional user data. 
Returns

Refer to VM_GSM_SMS_RESULT for return value and error code.

Example
void custom_sms_get_sc_address_callback(vm_gsm_sms_callback_t* callback_data)
{
    vm_gsm_sms_get_center_address_callback_t* sc_address;
    if(callback_data->action == VM_GSM_SMS_ACTION_GET_CENTER_ADDRESS)
    {
        if(callback_data->cause == VM_GSM_SMS_CAUSE_NO_ERROR)
        {
            if(!callback_data->action_data)
            {
                vm_log_debug("action data is NULL");
                return;
             }
             sc_address = (vm_gsm_sms_get_center_address_callback_t*)callback_data->action_data;
             vm_log_debug("sc_address is :%s.",(char*)sc_address->sms_center_address);
        }
        else
        {
             vm_log_debug("get sc failed,res != VM_GSM_SMS_CAUSE_NO_ERROR.");
        }
    }
}

void custom_sms_get_sc_address(void)
{
    VMINT res = 0;
    res = vm_gsm_sms_get_center_address(VM_GSM_SMS_SIM_1,
                                  custom_sms_get_sc_address_callback, NULL);
    if(res != VM_GSM_SMS_RESULT_OK)
    {
        vm_log_debug("custom_sms_get_sc_address: Gets SC address failed");
    }
}
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.