porting: Rename ble_npl_callout_queued

"is_active" is more consistent with other APIs naming like "is_empty" or
"is_queued". Also "active" instead of "queued" makes more sense since
this means callout is active and can fire on timeout. "queued" is just
related to implementation on Mynewt where active callout is put on
queue.

Return value is also changes for consistency.
This commit is contained in:
Andrzej Kaczmarek
2018-05-23 12:24:07 +02:00
parent 4c215e3cbd
commit 7e958b77de
6 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -1464,7 +1464,7 @@ ble_ll_conn_hci_wr_auth_pyld_tmo(uint8_t *cmdbuf, uint8_t *rsp, uint8_t *rsplen)
rc = BLE_ERR_INV_HCI_CMD_PARMS;
} else {
connsm->auth_pyld_tmo = tmo;
if (ble_npl_callout_queued(&connsm->auth_pyld_timer)) {
if (ble_npl_callout_is_active(&connsm->auth_pyld_timer)) {
ble_ll_conn_auth_pyld_timer_start(connsm);
}
}
+1 -1
View File
@@ -430,7 +430,7 @@ ble_hs_timer_sched(int32_t ticks_from_now)
* sooner than the previous expiration time.
*/
abs_time = ble_npl_time_get() + ticks_from_now;
if (!ble_npl_callout_queued(&ble_hs_timer_timer) ||
if (!ble_npl_callout_is_active(&ble_hs_timer_timer) ||
((ble_npl_stime_t)(abs_time -
ble_npl_callout_get_ticks(&ble_hs_timer_timer))) < 0) {
ble_hs_timer_reset(ticks_from_now);
+1 -1
View File
@@ -124,7 +124,7 @@ int ble_npl_callout_reset(struct ble_npl_callout *co, ble_npl_time_t ticks);
void ble_npl_callout_stop(struct ble_npl_callout *co);
int ble_npl_callout_queued(struct ble_npl_callout *co);
bool ble_npl_callout_is_active(struct ble_npl_callout *co);
uint32_t ble_npl_callout_get_ticks(struct ble_npl_callout *co);
+3 -3
View File
@@ -146,10 +146,10 @@ ble_npl_callout_stop(struct ble_npl_callout *co)
}
int
ble_npl_callout_queued(struct ble_npl_callout *c)
bool
ble_npl_callout_is_active(struct ble_npl_callout *c)
{
return 0;
return false;
}
ble_npl_time_t
@@ -222,8 +222,8 @@ ble_npl_callout_stop(struct ble_npl_callout *co)
xTimerStop(co->handle, portMAX_DELAY);
}
static inline int
ble_npl_callout_queued(struct ble_npl_callout *co)
static inline bool
ble_npl_callout_is_active(struct ble_npl_callout *co)
{
return xTimerIsTimerActive(co->handle) == pdTRUE;
}
@@ -210,8 +210,8 @@ ble_npl_callout_stop(struct ble_npl_callout *co)
os_callout_stop(&co->co);
}
static inline int
ble_npl_callout_queued(struct ble_npl_callout *co)
static inline bool
ble_npl_callout_is_active(struct ble_npl_callout *co)
{
return os_callout_queued(&co->co);
}