Syntax
VM_RESULT vm_gsm_sms_set_interrupt_event_handler(
    VM_GSM_SMS_EVENT_ID event_id, 
    vm_gsm_sms_event_callback event_callback, 
    void* user_data
);
ContentsIndex
PreviousUpNext
vm_gsm_sms_set_interrupt_event_handler
Example
Syntax
VM_RESULT vm_gsm_sms_set_interrupt_event_handler(
    VM_GSM_SMS_EVENT_ID event_id, 
    vm_gsm_sms_event_callback event_callback, 
    void* user_data
);
Description

Sets the interrupt handler for the specified event type.

Parameters
Parameters 
Description 
VM_GSM_SMS_EVENT_ID event_id 
[IN] Specifies the event type that the callback will listen to. 
vm_gsm_sms_event_callback event_callback 
[IN] The callback that listens to the events as specified by the event_id. 
void* user_data 
[IN] Additional user data. 
Returns

Refer to VM_GSM_SMS_RESULT for return value and error code.

Example
VMINT custom_sms_new_message_interrupt_proc(vm_gsm_sms_event_t* event_data)
{
    vm_gsm_sms_event_new_sms_t* event_new_message_ptr;
    vm_gsm_sms_new_message_t* new_message_ptr = NULL;
    VMINT res = 0;

    if(event_data->event_id == VM_GSM_SMS_EVENT_ID_SMS_NEW_MESSAGE)
    {
        event_new_message_ptr = (vm_gsm_sms_event_new_sms_t *)event_data->event_info; // Gets the event info.
        new_message_ptr = event_new_message_ptr->message_data; // Gets the message data.
        res = vm_gsm_sms_clear_interrupt_event_handler(event_data->event_id,
                                custom_sms_new_message_interrupt_proc, NULL);
        if(res != VM_GSM_SMS_RESULT_OK)
        {
             vm_log_debug("custom_sms_new_message_interrupt_proc have got new message, but cannot delete interrupt");
        }
    }
    return res;
}

void custom_sms_set_interrupt_event_handler_sample(void)
{
    VMINT return = 0;
    return = vm_gsm_sms_set_interrupt_event_handler(VM_GSM_SMS_EVENT_ID_SMS_NEW_MESSAGE,
                                             custom_sms_new_message_interrupt_proc, NULL);
    if(return != VM_GSM_SMS_RESULT_OK)
    {
        vm_log_debug("Cannot set interrupt!");
    }
}
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.