nfc_rfid_detector_app_i.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include "nfc_rfid_detector_app_i.h"
  2. #include <furi.h>
  3. #define TAG "NfcRfidDetector"
  4. void nfc_rfid_detector_app_field_presence_start(NfcRfidDetectorApp* app) {
  5. furi_assert(app);
  6. // start the field presence rfid detection
  7. furi_hal_rfid_field_detect_start();
  8. // start the field presence nfc detection
  9. furi_hal_nfc_acquire();
  10. furi_hal_nfc_field_detect_start();
  11. }
  12. void nfc_rfid_detector_app_field_presence_stop(NfcRfidDetectorApp* app) {
  13. furi_assert(app);
  14. // stop the field presence rfid detection
  15. furi_hal_rfid_field_detect_stop();
  16. // stop the field presence nfc detection
  17. furi_hal_nfc_field_detect_stop();
  18. furi_hal_nfc_release();
  19. }
  20. bool nfc_rfid_detector_app_field_presence_is_nfc(NfcRfidDetectorApp* app) {
  21. furi_assert(app);
  22. // check if the field presence is nfc
  23. bool is_present = furi_hal_nfc_field_is_present();
  24. return is_present;
  25. }
  26. bool nfc_rfid_detector_app_field_presence_is_rfid(NfcRfidDetectorApp* app, uint32_t* frequency) {
  27. furi_assert(app);
  28. // check if the field presence is rfid
  29. return furi_hal_rfid_field_is_present(frequency);
  30. }