<commit_before>#ifndef NfcAdapter_h
#define NfcAdapter_h

#include <Adafruit_NFCShield_I2C.h>
#include <NfcTag.h>
#include <Ndef.h>

// Drivers
#include <MifareClassic.h>
#include <MifareUltralight.h>

#define TAG_TYPE_MIFARE_CLASSIC (0)
#define TAG_TYPE_1 (1)
#define TAG_TYPE_2 (2)
#define TAG_TYPE_3 (3)
#define TAG_TYPE_4 (4)
#define TAG_TYPE_UNKNOWN (99)

#define IRQ   (2)
#define RESET (3)  // Not connected by default on the NFC Shield

/*
  • nfc.tagAvailable() -- returns tag UID when a tag is present
  • nfc.mimeTypeAvailable(char[] mimeType) --
  • nfc.ndefAvailable() -- returns the tag abstraction (presumably an NDEF or NDEFRecord) when an NDEF formatted tag is found
  • nfc.addNdefFormatableAvailable() -- returns tag UID when a tag is present
  • nfc.write()  -- based on Stream.write()
  * nfc.read() -- based on Stream.read()
  • nfc.share()
  • nfc.unshare()
  • nfc.erase()
*/

  class NfcAdapter {
  public:
    NfcAdapter(void);
    ~NfcAdapter(void); 
    void begin(void);
    boolean tagPresent(); // tagAvailable
    NfcTag read();
    boolean write(NdefMessage& ndefMessage);
  private:
    Adafruit_NFCShield_I2C* shield;
    uint8_t uid[7];    // Buffer to store the returned UID<commit_msg>cleanup<commit_after>#ifndef NfcAdapter_h
#define NfcAdapter_h

#include <Adafruit_NFCShield_I2C.h>
#include <NfcTag.h>
#include <Ndef.h>

// Drivers
#include <MifareClassic.h>
#include <MifareUltralight.h>

#define TAG_TYPE_MIFARE_CLASSIC (0)
#define TAG_TYPE_1 (1)
#define TAG_TYPE_2 (2)
#define TAG_TYPE_3 (3)
#define TAG_TYPE_4 (4)
#define TAG_TYPE_UNKNOWN (99)

#define IRQ   (2)
#define RESET (3)  // Not connected by default on the NFC Shield

  class NfcAdapter {
  public:
    NfcAdapter(void);
    ~NfcAdapter(void); 
    void begin(void);
    boolean tagPresent(); // tagAvailable
    NfcTag read();
    boolean write(NdefMessage& ndefMessage);
    // FUTURE boolean share(NdefMessage& ndefMessage);
    // FUTURE boolean unshare();
    // FUTURE boolean erase();
    // FUTURE boolean format();
  private:
    Adafruit_NFCShield_I2C* shield;
    uint8_t uid[7];    // Buffer to store the returned UID
{'fraction_non_alphanumeric': 0.11850117096018735, 'fraction_numerical': 0.01592505854800937, 'mean_word_length': 3.9444444444444446, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4385946', 'n_tokens_mistral': 829, 'n_tokens_neox': 791, 'n_words': 214}