예제 #1
0
OT_WEAK ot_u16 otapi_session_number() {
    if (session_notempty()) {
        m2session* active = session.top;
        return *((ot_u16*)&(active->channel));
    }
    return 0;
}
예제 #2
0
OT_WEAK ot_u16 otapi_close_request() {
/// Set the footer if the session is valid
    if (session_notempty()) {
        m2np_footer( /* session_top() */ );
        return 1;
    }
    return 0;
}
예제 #3
0
OT_WEAK ot_u16 otapi_open_request(addr_type addr, routing_tmpl* routing) {
/// Set the header if the session is valid.  Also conditionally write the header
/// depending on the address type (a parameter).  
    if (session_notempty()) {
        m2session* s_active;
        s_active = session_top();
        
        // Set the dll parameters to a safe setting; can be changed later
        dll_set_defaults(s_active);
    
        // Unicast/Anycast support routing, so copy the supplied template
        if ((addr & M2QUERY_GLOBAL) == 0) {   
            platform_memcpy((ot_u8*)&m2np.rt, (ot_u8*)routing, sizeof(routing_tmpl));
        }

        // Load the header
        m2np_header(s_active, (ot_u8)addr, M2FI_FRDIALOG);
        return 1;
    }
    return 0;
}
예제 #4
0
OT_WEAK void dll_clock(ot_uint clocks) {
  //dll.comm.tca   -= clocks;
  //dll.comm.tc    -= clocks;
    clocks          = CLK2TI(clocks);

    if (sys.task_RFA.event != 0) {
        dll.comm.rx_timeout -= clocks;
    }
    else if (session_notempty()) {
        sys.task_RFA.event      = 2;
        sys.task_RFA.nextevent  = clocks + session_getnext();

        // Synchronization test
        //volatile ot_u16 next_session;
        //next_session            = session_getnext();
        //sys.task_RFA.nextevent  = next_session;
       // if (next_session != 0) {
        //    sample_t1 = 0;
        //}
    }
}