mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2025-02-17 19:19:16 +01:00
aciodrv: address some magic numbers with felica polling
This commit is contained in:
parent
f9b37c7a72
commit
9cef7c03d0
@ -5,6 +5,9 @@
|
||||
|
||||
#include "aciodrv/icca.h"
|
||||
|
||||
|
||||
#define IDLE_RESPONSES_BETWEEN_FELICA_POLLS 5
|
||||
|
||||
struct icca_handler_ctx {
|
||||
bool init;
|
||||
bool slotted_reader;
|
||||
@ -114,7 +117,7 @@ bool aciotest_icca_handler_update(
|
||||
++icca_ctx->last_poll;
|
||||
}
|
||||
|
||||
if (icca_ctx->last_poll >= 5) {
|
||||
if (icca_ctx->last_poll >= IDLE_RESPONSES_BETWEEN_FELICA_POLLS) {
|
||||
if (!aciodrv_icca_poll_felica(device, node_id)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "util/log.h"
|
||||
|
||||
#define IDLE_RESPONSES_BETWEEN_FELICA_POLLS 5
|
||||
#define NUMBER_OF_EMULATED_READERS 2
|
||||
#define INVALID_NODE_ID -1
|
||||
|
||||
@ -133,11 +134,9 @@ bool eam_io_init(
|
||||
}
|
||||
|
||||
icca_node_id[i] = nid;
|
||||
|
||||
icca_is_slotted[i] = true;
|
||||
icca_poll_counter[i] = 0;
|
||||
|
||||
icca_is_slotted[i] = aciodrv_icca_is_slotted(device, nid);
|
||||
log_misc("ICC reader %d is_slotted: %d", nid, icca_is_slotted[i]);
|
||||
|
||||
if (!aciodrv_icca_init(device, icca_node_id[i])) {
|
||||
log_warning("Initializing icca %d failed", i);
|
||||
@ -279,7 +278,7 @@ bool eam_io_poll(uint8_t unit_no)
|
||||
// we must manually call this every few polls to actually update the felica state
|
||||
// we don't do it every poll, since card polling isn't that time sensitive of an operation
|
||||
// libacio does it every 5ish polls after the last AC_IO_ICCA_STATUS_BUSY_NEW message
|
||||
if (icca_poll_counter[unit_no] >= 5) {
|
||||
if (icca_poll_counter[unit_no] >= IDLE_RESPONSES_BETWEEN_FELICA_POLLS) {
|
||||
response = aciodrv_icca_poll_felica(
|
||||
aciomgr_port_checkout(acio_manager_ctx),
|
||||
icca_node_id[unit_no]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user