Class: NFC::Device::Modulation

Inherits:
Object
  • Object
show all
Defined in:
ext/nfc/nfc_device.c

Constant Summary collapse

NMT_ISO14443A =

modulation types.

INT2NUM(NMT_ISO14443A)
NMT_FELICA =
INT2NUM(NMT_FELICA)
NBR_UNDEFINED =

baud rates

INT2NUM(NBR_UNDEFINED)
NBR_106 =
INT2NUM(NBR_106)
NBR_212 =
INT2NUM(NBR_212)

Instance Method Summary collapse

Constructor Details

#initialize(type, baud) ⇒ Object



138
139
140
141
142
143
144
145
146
147
# File 'ext/nfc/nfc_device.c', line 138

static VALUE mod_initialize(VALUE self, VALUE type, VALUE baud)
{
    nfc_modulation * mod;

    Data_Get_Struct(self, nfc_modulation, mod);
    mod->nmt = NUM2INT(type);
    mod->nbr = NUM2INT(baud);

    return self;
}

Instance Method Details

#nbrObject



167
168
169
170
171
172
173
174
# File 'ext/nfc/nfc_device.c', line 167

static VALUE mod_nbr(VALUE self)
{
    nfc_modulation * mod;

    Data_Get_Struct(self, nfc_modulation, mod);

    return INT2NUM(mod->nbr);
}

#nmtObject



158
159
160
161
162
163
164
165
# File 'ext/nfc/nfc_device.c', line 158

static VALUE mod_nmt(VALUE self)
{
    nfc_modulation * mod;

    Data_Get_Struct(self, nfc_modulation, mod);

    return INT2NUM(mod->nmt);
}