#include "fuzz_cmn.h"
#include "nfa_api.h"
#include "nfa_nfcee_int.h"

// These are the functions implemented elsewhere in the NFC code. Our fuzzing
// doesn't need them. To avoid pulling into more source code we simply stub
// them out.

tNFA_PROPRIETARY_CFG nfa_proprietary_cfg = {
    0x80, /* NCI_PROTOCOL_18092_ACTIVE */
    0x81, /* NCI_PROTOCOL_B_PRIME */
    0x82, /* NCI_PROTOCOL_DUAL */
    0x83, /* NCI_PROTOCOL_15693 */
    0x8A, /* NCI_PROTOCOL_KOVIO */
    0xFF, /* NCI_PROTOCOL_MIFARE */
    0x77, /* NCI_DISCOVERY_TYPE_POLL_KOVIO */
    0x74, /* NCI_DISCOVERY_TYPE_POLL_B_PRIME */
    0xF4, /* NCI_DISCOVERY_TYPE_LISTEN_B_PRIME */
};

tNFA_PROPRIETARY_CFG* p_nfa_proprietary_cfg =
    (tNFA_PROPRIETARY_CFG*)&nfa_proprietary_cfg;

void nfc_start_quick_timer(TIMER_LIST_ENT*, uint16_t, uint32_t) {}
void nfc_stop_timer(TIMER_LIST_ENT*) {}
void nfc_stop_quick_timer(TIMER_LIST_ENT*) {}
uint8_t NFC_GetNCIVersion() { return NCI_VERSION_2_0; }

tNFC_STATUS NFC_SendData(uint8_t conn_id, NFC_HDR* p_data) {
  uint8_t* p = (uint8_t*)(p_data + 1) + p_data->offset;
  uint8_t len = (uint8_t)p_data->len;

  FUZZLOG("conn_id=%d, data=%s", conn_id, BytesToHex(p, len).c_str());
  GKI_freebuf(p_data);
  return NFC_STATUS_OK;
}

void NFC_SetStaticT4tNfceeCback(tNFC_CONN_CBACK*, uint8_t) {}

bool NFA_T4tNfcEeIsProcessing() { return NFC_STATUS_OK; }

tNFA_T4TNFCEE_CB nfa_t4tnfcee_cb;

uint8_t nci_snd_t3t_polling(uint16_t system_code, uint8_t rc, uint8_t tsn) {
  FUZZLOG("sc=%04X, rc=%02X, tsn=%02X", system_code, rc, tsn);
  return NFC_STATUS_OK;
}

tNFC_CONN_CBACK* rf_cback = nullptr;
void NFC_SetStaticRfCback(tNFC_CONN_CBACK* p_cback) { rf_cback = p_cback; }

tNFC_STATUS NFC_ISODEPNakPresCheck() { return NFC_STATUS_OK; }

std::string NFC_GetStatusName(tNFC_STATUS status) {
  switch (status) {
    case NFC_STATUS_OK:
      return "OK";
    case NFC_STATUS_REJECTED:
      return "REJECTED";
    case NFC_STATUS_MSG_CORRUPTED:
      return "CORRUPTED";
    case NFC_STATUS_BUFFER_FULL:
      return "BUFFER_FULL";
    case NFC_STATUS_FAILED:
      return "FAILED";
    case NFC_STATUS_NOT_INITIALIZED:
      return "NOT_INITIALIZED";
    case NFC_STATUS_SYNTAX_ERROR:
      return "SYNTAX_ERROR";
    case NFC_STATUS_SEMANTIC_ERROR:
      return "SEMANTIC_ERROR";
    case NFC_STATUS_UNKNOWN_GID:
      return "UNKNOWN_GID";
    case NFC_STATUS_UNKNOWN_OID:
      return "UNKNOWN_OID";
    case NFC_STATUS_INVALID_PARAM:
      return "INVALID_PARAM";
    case NFC_STATUS_MSG_SIZE_TOO_BIG:
      return "MSG_SIZE_TOO_BIG";
    case NFC_STATUS_ALREADY_STARTED:
      return "ALREADY_STARTED";
    case NFC_STATUS_ACTIVATION_FAILED:
      return "ACTIVATION_FAILED";
    case NFC_STATUS_TEAR_DOWN:
      return "TEAR_DOWN";
    case NFC_STATUS_RF_TRANSMISSION_ERR:
      return "RF_TRANSMISSION_ERR";
    case NFC_STATUS_RF_PROTOCOL_ERR:
      return "RF_PROTOCOL_ERR";
    case NFC_STATUS_TIMEOUT:
      return "TIMEOUT";
    case NFC_STATUS_EE_INTF_ACTIVE_FAIL:
      return "EE_INTF_ACTIVE_FAIL";
    case NFC_STATUS_EE_TRANSMISSION_ERR:
      return "EE_TRANSMISSION_ERR";
    case NFC_STATUS_EE_PROTOCOL_ERR:
      return "EE_PROTOCOL_ERR";
    case NFC_STATUS_EE_TIMEOUT:
      return "EE_TIMEOUT";
    case NFC_STATUS_CMD_STARTED:
      return "CMD_STARTED";
    case NFC_STATUS_HW_TIMEOUT:
      return "HW_TIMEOUT";
    case NFC_STATUS_CONTINUE:
      return "CONTINUE";
    case NFC_STATUS_REFUSED:
      return "REFUSED";
    case NFC_STATUS_BAD_RESP:
      return "BAD_RESP";
    case NFC_STATUS_CMD_NOT_CMPLTD:
      return "CMD_CMPLTD";
    case NFC_STATUS_NO_BUFFERS:
      return "NO_BUFFERS";
    case NFC_STATUS_WRONG_PROTOCOL:
      return "WRONG_PROTOCOL";
    case NFC_STATUS_BUSY:
      return "BUSY";
    case NFC_STATUS_LINK_LOSS:
      return "LINK_LOSS";
    case NFC_STATUS_BAD_LENGTH:
      return "BAD_LENGTH";
    case NFC_STATUS_BAD_HANDLE:
      return "BAD_HANDLE";
    case NFC_STATUS_CONGESTED:
      return "CONGESTED";
    default:
      return "UNKNOWN";
  }
}