Esempio n. 1
0
vm_phb_req_error_enum vm_sal_phb_get_contact_syn(vm_phb_get_req_struct* req_info)
{
    srv_phb_sdk_get_req_struct  req;
    srv_phb_sdk_contact_struct * contact = NULL;
    VMINT result = -1;
    vm_phb_req_error_enum res = VM_PHB_REQ_ERROR;

    contact = vm_calloc(sizeof(srv_phb_sdk_contact_struct));
    if(contact == NULL)
    {
        vm_log_error("vm_sal_phb_get_contact_syn:contact == NULL");
        return VM_PHB_REQ_ERROR;	
    }

    memset(&req, 0, sizeof(req));	

    req.contact_ptr = contact;
    vm_phb_build_contact_pos(&req ,  req_info);

    result = srv_phb_sdk_get_contact(&req);
    if(result == SRV_PHB_NO_ERROR)  
    {
        vm_phb_build_contact_ptr(req_info->contact_ptr, req.contact_ptr);
        res = VM_PHB_REQ_NO_ERROR;
    }

    vm_log_debug("vm_sal_phb_get_contact_syn:vm_get_tick_count2()=%d",vm_get_tick_count()); 	
    vm_free(contact);
    vm_log_debug("vm_sal_phb_get_contact_syn:end");  

    return res;

}
Esempio n. 2
0
uint32_t millis( void )
{
// todo: ensure no interrupts
    return vm_get_tick_count() ;
}