This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52 NFC record_text example

Hi all,

Is possible using NFC to send variable message? I want to send a counter event (data I got via BLE) to the NFC module.

Using the example I was not able to do it because the message has to be "constant"

inside the XX_record_add functions I tried, but I did not have luck

any suggestion?

Thanks

Parents
  • Hi,

    This should be possible. The reason that the member of the record descriptor is declared as const is that it must be consistent for the time the encode function works, to avoid that the data get corrupted.

    As long as you make sure that the variable does not change during the time the encoder function work, you should be able to ignore the warning or typecast your variable to a constant.

    Note that you need to stop and reinitialize the NFC tag emulation when updating the value, by calling nfc_t2t_emulation_stop() and nfc_t2t_emulation_start().

    I have attached an example that output a count value on the NFC interface once every second: nfc_record_variable.zip

    Best regards,

    Jørgen

Reply
  • Hi,

    This should be possible. The reason that the member of the record descriptor is declared as const is that it must be consistent for the time the encode function works, to avoid that the data get corrupted.

    As long as you make sure that the variable does not change during the time the encoder function work, you should be able to ignore the warning or typecast your variable to a constant.

    Note that you need to stop and reinitialize the NFC tag emulation when updating the value, by calling nfc_t2t_emulation_stop() and nfc_t2t_emulation_start().

    I have attached an example that output a count value on the NFC interface once every second: nfc_record_variable.zip

    Best regards,

    Jørgen

Children
Related