Ejemplo n.º 1
0
/*
  start the guard timer associated with the transaction

@param     : entry_p : pointer to the transaction context
@param     : uint32_t  : delay in seconds (??)
@retval   : none
*/
void north_lbg_entry_start_timer(north_lbg_entry_ctx_t *entry_p,uint32_t time_ms) 
{
 uint8_t slot;
 time_t delay;
  /*
  **  remove the timer from its current list
  */
  slot = NORTH_LBG_TMR_SLOT0;

//  entry_p->rpc_guard_timer_flg = FALSE;
  north_lbg_tmr_stop(&entry_p->rpc_guard_timer);
  
  // Take into account the last reconnect attemp time 
  // to adjust timer duration in order to reconnect 
  // every time_ms
  delay = (time(NULL) - entry_p->last_reconnect_time)*1024;
  time_ms *= 1024;
  if (delay >= 0) {
    if   (delay < time_ms) time_ms -= delay;
    else                   time_ms = 100;
  }
  north_lbg_tmr_start(slot,
                  &entry_p->rpc_guard_timer,
		  time_ms,
                  north_lbg_entry_timeout_CBK,
		  (void*) entry_p);

}
Ejemplo n.º 2
0
/*
  start the guard timer associated with the transaction

@param     : entry_p : pointer to the transaction context
@param     : uint32_t  : delay in seconds (??)
@retval   : none
*/
void north_lbg_entry_start_timer(north_lbg_entry_ctx_t *entry_p,uint32_t time_ms) 
{
 uint8_t slot;
  /*
  **  remove the timer from its current list
  */
  slot = NORTH_LBG_TMR_SLOT0;

//  entry_p->rpc_guard_timer_flg = FALSE;
  north_lbg_tmr_stop(&entry_p->rpc_guard_timer);
  north_lbg_tmr_start(slot,
                  &entry_p->rpc_guard_timer,
		  time_ms*1000,
                  north_lbg_entry_timeout_CBK,
		  (void*) entry_p);

}
Ejemplo n.º 3
0
void north_lbg_entry_stop_timer(north_lbg_entry_ctx_t *pObj)
{
 
//  pObj->rpc_guard_timer_flg = FALSE;
  north_lbg_tmr_stop(&pObj->rpc_guard_timer); 
}