use super::NfcId1;

/// NFC-A Listen device types
#[repr(u8)]
#[derive(Copy, Clone, Debug, PartialEq)]
enum ListenDeviceType {
    T1T = 0x01,
    T2T = 0x00,
    T4T = 0x20,
    NfcDep = 0x40,
    T4tNfcDep = 0x60,
}

/// SENS_RES (ATQA) format  Digital 1.1  6.6.3 & Table 7
#[derive(Copy, Clone, Debug, PartialEq)]
struct SensRes {
    anti_collision_info: u8,
    platform_info: u8,
}

/// SDD_REQ (Anticollision) format   Digital 1.1  6.7.1 & Table 11
#[derive(Copy, Clone, Debug, PartialEq)]
struct SddReq {
    sel_cmd: u8,
    sel_par: u8,
}

/// SDD_RES (UID CLn) format   Digital 1.1  6.7.2 & Table 15
#[derive(Copy, Clone, Debug, PartialEq)]
struct SddRes {
    uid: NfcId1,
    bcc: u8,
}

/// SEL_REQ (Select) format   Digital 1.1  6.8.1 & Table 17
#[derive(Copy, Clone, Debug, PartialEq)]
struct SelReq {
    sel_cmd: u8,
    sel_par: u8,
    uid: NfcId1,
    bcc: u8,
}

/// SEL_RES (SAK) format   Digital 1.1  6.8.2 & Table 19
#[derive(Copy, Clone, Debug, PartialEq)]
struct SelRes {
    sak: u8,
}

/// NFC-A listener device (PICC) struct
pub(crate) struct NFCAListenDevice {
    device_type: ListenDeviceType,
    sens_res: SensRes,
    sel_res: SelRes,
    nfcid1: NfcId1,
    // FIXME: T1T not implemented
    is_sleeping: bool,
}