Closed gvinet closed 3 years ago
About error with
dnfc2> set-nfc-mode nfc-mode 7
nfc-mode = 7
nfc-mode-tx_br = 0
nfc-mode-rx_br = 0
rfalSetMode Error 7
It is normal to have an error with that configuration as RFAL_MODE_POLL_NFCV does not support nfc-mode-tx_br / nfc-mode-rx_br RFAL_BR_106 (0) It support only nfc-mode-tx_br => RFAL_BR_1p66 or RFAL_BR_26p48 nfc-mode-rx_br =>RFAL_BR_26p48 or RFAL_BR_52p97
RFAL_BR_52p97 = 0xEB, /*!< Bit Rate 52.97 kbit/s (fc/256) Fast Mode VICC->VCD */
RFAL_BR_26p48 = 0xEC, /*!< Bit Rate 26,48 kbit/s (fc/512) NFCV VICC->VCD & VCD->VICC 1of4 */
RFAL_BR_1p66 = 0xED, /*!< Bit Rate 1,66 kbit/s (fc/8192) NFCV VCD->VICC 1of256 */
Yes so far it is intended to be done in one step like that
dnfc2> set-nfc-mode nfc-mode 7 nfc-mode-tx_br 236 nfc-mode-rx_br 236
nfc-mode = 7
nfc-mode-tx_br = 236
nfc-mode-rx_br = 236
rfalSetMode OK
dnfc2> get-nfc-mode
nfc-mode = 7
nfc-mode-tx_br = 236
nfc-mode-rx_br = 236
I'm agree that it can be improved to keep previous value if they are not defined
Now it is fixed and tested with different cases
dnfc2> set-nfc-mode nfc-mode 7
nfc-mode = 7
nfc-mode-tx_br = 0
nfc-mode-rx_br = 0
rfalSetMode Error 7
dnfc2> set-nfc-mode nfc-mode-tx_br 236
nfc-mode = 7
nfc-mode-tx_br = 236
nfc-mode-rx_br = 0
rfalSetMode Error 7
dnfc2> set-nfc-mode nfc-mode-rx_br 236
nfc-mode = 7
nfc-mode-tx_br = 236
nfc-mode-rx_br = 236
rfalSetMode OK
dnfc2> set-nfc-mode nfc-mode 1 nfc-mode-tx_br 0 nfc-mode-rx_br 0
nfc-mode = 1
nfc-mode-tx_br = 0
nfc-mode-rx_br = 0
rfalSetMode OK
dnfc2> set-nfc-mode nfc-mode 7 nfc-mode-tx_br 236 nfc-mode-rx_br 236
nfc-mode = 7
nfc-mode-tx_br = 236
nfc-mode-rx_br = 236
rfalSetMode OK
I want to use a vicinity card in dfnc menu, so I want to configure it like in rfalNfcvPollerInitialize:
I go in dnfc mode to set NFCV
But, the error 7 is raised. Why? We go in hydranfc_v2_dnfc_mode.c file, in exec function. First, the mode is copied
Then, it is set
but the default value for nfc_mode_tx_bitrate/nfc_mode_rx_bitrate are not compatible, so an error is raised.
Ok, but if I want to update the rx mode for instance, the mode modification is not taken into account:
It comes from the previous modification was not recorded: default value are retrieved at the beginning of exec function:
nfc_mode, nfc_mode_tx_bitrate, nfc_mode_rx_bitrate could be move out the function and be defined as global to resolve this problem.