Damn scalar initializers

This commit is contained in:
Ondrej Mikle 2014-07-19 01:43:28 +02:00
parent cafd967ed6
commit cb05d5a063
2 changed files with 32 additions and 0 deletions

View file

@ -1,14 +1,32 @@
#include <string>
#include <nfc/nfc.h>
#include <nfc/nfc-types.h>
#include "brmdoor_nfc.h"
using namespace std;
NFCDevice::NFCDevice()
{
pollNr = 20;
pollPeriod = 2;
}
std::string NFCDevice::scanUID()
{
return "1234";
}
const nfc_modulation NFCDevice::_modulations[5] = {
{ /*.nmt = */ NMT_ISO14443A, /* .nbr = */ NBR_106 },
{ /*.nmt = */ NMT_ISO14443B, /* .nbr = */ NBR_106 },
{ /*.nmt = */ NMT_FELICA, /* .nbr = */ NBR_212 },
{ /*.nmt = */ NMT_FELICA, /* .nbr = */ NBR_424 },
{ /*.nmt = */ NMT_JEWEL, /* .nbr = */ NBR_106 },
};
const size_t _modulationsLen = 5;

View file

@ -1,6 +1,10 @@
#pragma once
#include <string>
#include <inttypes.h>
#include <nfc/nfc.h>
#include <nfc/nfc-types.h>
class NFCDevice
{
@ -12,4 +16,14 @@ public:
~NFCDevice() {}
std::string scanUID();
uint8_t pollNr;
uint8_t pollPeriod;
protected:
static const nfc_modulation _modulations[5];
static const size_t _modulationsLen = 5;
};