EL_dev_arduino 2.6.0
読み取り中…
検索中…
一致する文字列を見つけられません
/Users/sugimura/EL_dev_arduino/ELOBJ.h
[詳解]
1
8#ifndef __ELOBJ_H__
9#define __ELOBJ_H__
10#pragma once
11
12#include <initializer_list>
13
14// auto config
15#ifndef GPP
16// arduino
17#include <Arduino.h>
18
19#else
20// g++
21#define byte unsigned char
22#include <iostream>
23using std::cout;
24using std::dec;
25using std::endl;
26using std::hex;
27using std::move;
28#endif
29
34class PDCEDT
35{
36protected:
37 byte *m_pdcedt;
38 byte length;
39
40public:
41 PDCEDT();
42 PDCEDT(const PDCEDT &val);
43 PDCEDT(const byte *val);
44 PDCEDT(std::initializer_list<byte> il);
45
46 virtual ~PDCEDT();
47
48 // setter
49 const PDCEDT operator=(const PDCEDT val);
50 const byte *operator=(const byte *val);
51 const byte *operator=(std::initializer_list<byte> il);
52 const byte *setEDT(std::initializer_list<byte> il);
53
54 // getter
55 const byte getLength() const;
56 const byte getPDC() const;
57 const byte *getEDT() const;
58
59 // キャスト
60 operator byte *() const;
61
62 // チェック
63 const bool isEmpty() const;
64 const bool isNull() const;
65
66 void print(void) const;
67};
68
73class ELOBJ
74{
75 // メンバ変数定義
76protected:
77 const static byte PDC_MAX = 0x80;
79
80 // member function
81public:
82 ELOBJ(); // 構築
83 virtual ~ELOBJ(); // 消滅
84
85 // データ取得
86 const PDCEDT GetPDCEDT(const byte epc) const;
87 const PDCEDT SetPDCEDT(const byte epc, const PDCEDT pdcedt);
88 const PDCEDT SetPDCEDT(const byte epc, const byte *&&pdcedt);
89 const PDCEDT SetProfile(const byte epc, std::initializer_list<byte> epcs); // for EPC: 9e,9d,9f
90 const PDCEDT GetProfile(const byte epc) const;
91
92 const bool hasGetProfile(const byte epc) const; // Get可能なEPC?
93 const bool hasSetProfile(const byte epc) const; // Set可能なEPC?
94 const bool hasInfProfile(const byte epc) const; // Inf必須なEPC?
95
96 // 配列らしいインターフェイス
97 const PDCEDT operator[](const byte epc) const;
98 PDCEDT &operator[](const byte epc);
99
100 // 状態表示系
101 void printAll() const; // all print edt
102};
103
104#endif
106// EOF
EL Object
Definition: ELOBJ.h:74
const PDCEDT GetProfile(const byte epc) const
Profile(0x9d, 0x9e, 0x9f)を計算してPDC[1] + EDT[PDC]の形で返す
Definition: ELOBJ.cpp:437
const PDCEDT SetPDCEDT(const byte epc, const PDCEDT pdcedt)
EPCに対して、PDCEDTのを結びつける(セットと更新)
Definition: ELOBJ.cpp:366
void printAll() const
null以外のEPCを全部出力
Definition: ELOBJ.cpp:578
virtual ~ELOBJ()
デストラクタ
Definition: ELOBJ.cpp:342
ELOBJ()
コンストラクタ
Definition: ELOBJ.cpp:331
const PDCEDT SetProfile(const byte epc, std::initializer_list< byte > epcs)
Profile(0x9d, 0x9e, 0x9f)を計算してPDCとEDTを設定する
Definition: ELOBJ.cpp:398
const bool hasSetProfile(const byte epc) const
指定のEPCがSet可能かどうか
Definition: ELOBJ.cpp:501
PDCEDT m_pdcedt[PDC_MAX]
= m_pdcedt[EPC] (EPC mapped( EPC - 0x80 = 0.. 0xFF = 0x80 );
Definition: ELOBJ.h:78
const PDCEDT operator[](const byte epc) const
配列らしいインターフェイス,const this
Definition: ELOBJ.cpp:551
static const byte PDC_MAX
PDC_MAX 0xFF - 0x79
Definition: ELOBJ.h:77
const bool hasGetProfile(const byte epc) const
指定のEPCがGet可能かどうか
Definition: ELOBJ.cpp:486
const PDCEDT GetPDCEDT(const byte epc) const
キー文字列からデータ取得
Definition: ELOBJ.cpp:354
const bool hasInfProfile(const byte epc) const
指定のEPCがINF必須かどうか
Definition: ELOBJ.cpp:527
PDC and EDT in ELOBJ
Definition: ELOBJ.h:35
const bool isNull() const
Nullかどうか
Definition: ELOBJ.cpp:265
virtual ~PDCEDT()
デストラクタ
Definition: ELOBJ.cpp:78
void print(void) const
デバグ用の標準出力
Definition: ELOBJ.cpp:279
const PDCEDT operator=(const PDCEDT val)
operator=
Definition: ELOBJ.cpp:96
const byte * setEDT(std::initializer_list< byte > il)
EDT setter
Definition: ELOBJ.cpp:182
const bool isEmpty() const
設定されているかどうか
Definition: ELOBJ.cpp:251
byte * m_pdcedt
PDC(1 Byte) + EDT(n Byte)
Definition: ELOBJ.h:37
PDCEDT()
コンストラクタ
Definition: ELOBJ.cpp:15
byte length
length for m_pdcedt
Definition: ELOBJ.h:38
const byte getPDC() const
PDC getter
Definition: ELOBJ.cpp:225
const byte * getEDT() const
EDT getter
Definition: ELOBJ.cpp:238
const byte getLength() const
PDCEDT Length getter
Definition: ELOBJ.cpp:212
byte * pdcedt
Definition: main.cpp:56