source: UsbWattMeter/trunk/ecnl_lwip/echonet_chk.tf@ 164

Last change on this file since 164 was 164, checked in by coas-nagasima, 6 years ago

TOPPERS/ECNLサンプルアプリ「USB充電器電力計」を追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/plain
File size: 6.1 KB
Line 
1$ =====================================================================
2$
3$ TOPPERS ECHONET Lite Communication Middleware
4$
5$ Copyright (C) 2014-2016 Cores Co., Ltd. Japan
6$
7$ ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
8$ ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
9$ •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
10$ (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
11$ Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
12$ ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
13$ (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
14$ —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
15ƒƒ“ƒgi—˜—p
16$ ŽÒƒ}ƒjƒ…
17ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
18$ ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
19$ (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
20$ —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
21$ ‚ƁD
22$ (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
23ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
24ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
25$ ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
26$ (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
27$ •ñ‚·‚邱‚ƁD
28$ (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
29$ ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
30$ ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
31$ —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
32$ –Ɛӂ·‚邱‚ƁD
33$
34$ –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
35$ ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
36$ ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
37$ ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
38$ ‚̐ӔC‚𕉂í‚È‚¢D
39$
40$ @(#) $Id: echonet_chk.tf 164 2016-03-07 11:33:50Z coas-nagasima $
41$
42$ =====================================================================
43
44$ =====================================================================
45$ •K{ƒvƒƒpƒeƒB‚̃`ƒFƒbƒN
46$ =====================================================================
47
48$FUNCTION compare$
49 $RESULT = ARGV[1] - ARGV[2]$
50$END$
51
52$ ƒvƒƒtƒ@ƒCƒ‹ƒIƒuƒWƒFƒNƒgƒX[ƒp[ƒNƒ‰ƒX
53$ProfileObjectSuperClass.EPC = { 0x88, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x9D, 0x9E, 0x9F }$
54$ProfileObjectSuperClass.MUST = { EPC_NONE, EPC_RULE_GET, EPC_NONE, EPC_NONE, EPC_NONE, EPC_NONE, EPC_RULE_GET, EPC_RULE_GET, EPC_RULE_GET }$
55
56$ ƒm[ƒhƒvƒƒtƒ@ƒCƒ‹ƒNƒ‰ƒX
57$NodeProfileClass.EPC = { 0x80, 0x82, 0x83, 0x89, 0xBF, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7 }$
58$NodeProfileClass.MUST = { EPC_RULE_GET, EPC_RULE_GET, EPC_RULE_GET, EPC_NONE, EPC_NONE, EPC_RULE_GET, EPC_RULE_GET, EPC_RULE_ANNO, EPC_RULE_GET, EPC_RULE_GET }$
59
60$ ‹@ŠíƒIƒuƒWƒFƒNƒgƒX[ƒp[ƒNƒ‰ƒX
61$DeviceSuperClass.EPC = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x93, 0x97, 0x98, 0x99, 0x9A, 0x9D, 0x9E, 0x9F }$
62$DeviceSuperClass.MUST = { EPC_RULE_GET, EPC_RULE_SET|EPC_RULE_GET, EPC_RULE_GET, EPC_NONE, EPC_NONE, EPC_NONE, EPC_NONE, EPC_NONE, EPC_RULE_GET, EPC_NONE, EPC_RULE_GET, EPC_NONE, EPC_NONE, EPC_NONE, EPC_NONE, EPC_NONE, EPC_NONE, EPC_NONE, EPC_NONE, EPC_NONE, EPC_NONE, EPC_RULE_GET, EPC_RULE_GET, EPC_RULE_GET }$
63
64$ResultOfGetPropertyInfo = {}$
65
66$FUNCTION GetPropertyInfo$
67 $eoj.x1 = ARGV[1]$
68 $eoj.x2 = ARGV[2]$
69 $attr = ARGV[3]$
70 $list = {}$
71 $FOREACH i { 0 , 1 , ... , 15 }$
72 $map[i] = 0x00$
73 $END$
74
75 $IF (attr != EPC_ANNOUNCE) && (attr != EPC_RULE_SET) && (attr != EPC_RULE_GET)$
76 $ERROR$$FORMAT("%1% is illegal value, must be EPC_RULE_ANNO or EPC_RULE_SET or EPC_RULE_GET.", attr)$$END$
77 $END$
78
79 $IF eoj.x1 == EOJ_X1_SENSOR$
80 $i = 0$
81 $WHILE i < LENGTH(DeviceSuperClass.EPC)$
82 $IF (AT(DeviceSuperClass.MUST, i) & attr) != 0$
83 $list = APPEND(list, AT(DeviceSuperClass.EPC, i))$
84 $END$
85 $i = i + 1$
86 $END$
87 $ELIF eoj.x1 == EOJ_X1_AIR_CONDITIONER$
88 $i = 0$
89 $WHILE i < LENGTH(DeviceSuperClass.EPC)$
90 $IF (AT(DeviceSuperClass.MUST, i) & attr) != 0$
91 $list = APPEND(list, AT(DeviceSuperClass.EPC, i))$
92 $END$
93 $i = i + 1$
94 $END$
95 $ELIF eoj.x1 == EOJ_X1_AMENITY$
96 $i = 0$
97 $WHILE i < LENGTH(DeviceSuperClass.EPC)$
98 $IF (AT(DeviceSuperClass.MUST, i) & attr) != 0$
99 $list = APPEND(list, AT(DeviceSuperClass.EPC, i))$
100 $END$
101 $i = i + 1$
102 $END$
103 $ELIF eoj.x1 == EOJ_X1_HOUSEWORK$
104 $i = 0$
105 $WHILE i < LENGTH(DeviceSuperClass.EPC)$
106 $IF (AT(DeviceSuperClass.MUST, i) & attr) != 0$
107 $list = APPEND(list, AT(DeviceSuperClass.EPC, i))$
108 $END$
109 $i = i + 1$
110 $END$
111 $ELIF eoj.x1 == EOJ_X1_WELLNESS$
112 $i = 0$
113 $WHILE i < LENGTH(DeviceSuperClass.EPC)$
114 $IF (AT(DeviceSuperClass.MUST, i) & attr) != 0$
115 $list = APPEND(list, AT(DeviceSuperClass.EPC, i))$
116 $END$
117 $i = i + 1$
118 $END$
119 $ELIF eoj.x1 == EOJ_X1_CONTROLLER$
120 $i = 0$
121 $WHILE i < LENGTH(DeviceSuperClass.EPC)$
122 $IF (AT(DeviceSuperClass.MUST, i) & attr) != 0$
123 $list = APPEND(list, AT(DeviceSuperClass.EPC, i))$
124 $END$
125 $i = i + 1$
126 $END$
127 $ELIF eoj.x1 == EOJ_X1_AUDIO_VISUAL$
128 $i = 0$
129 $WHILE i < LENGTH(DeviceSuperClass.EPC)$
130 $IF (AT(DeviceSuperClass.MUST, i) & attr) != 0$
131 $list = APPEND(list, AT(DeviceSuperClass.EPC, i))$
132 $END$
133 $i = i + 1$
134 $END$
135 $ELIF eoj.x1 == EOJ_X1_PROFILE$
136 $i = 0$
137 $WHILE i < LENGTH(ProfileObjectSuperClass.EPC)$
138 $IF (AT(ProfileObjectSuperClass.MUST, i) & attr) != 0$
139 $list = APPEND(list, AT(ProfileObjectSuperClass.EPC, i))$
140 $END$
141 $i = i + 1$
142 $END$
143 $IF eoj.x2 == EOJ_X2_NODE_PROFILE$
144 $i = 0$
145 $WHILE i < LENGTH(NodeProfileClass.EPC)$
146 $IF (AT(NodeProfileClass.MUST, i) & attr) != 0$
147 $list = APPEND(list, AT(NodeProfileClass.EPC, i))$
148 $END$
149 $i = i + 1$
150 $END$
151 $END$
152 $ELIF eoj.x1 == EOJ_X1_USER_DEFINED$
153 $i = 0$
154 $WHILE i < LENGTH(DeviceSuperClass.EPC)$
155 $IF (AT(DeviceSuperClass.MUST, i) & attr) != 0$
156 $list = APPEND(list, AT(DeviceSuperClass.EPC, i))$
157 $END$
158 $i = i + 1$
159 $END$
160 $END$
161
162 $i = 0$
163 $WHILE i < LENGTH(list)$
164 $pos = AT(list, i) & 0xF$
165 $bit = (AT(list, i) >> 4) - 8$
166 $map[pos] = map[pos] | (1 << bit)$
167 $i = i + 1$
168 $END$
169
170 $ResultOfGetPropertyInfo = {}$
171 $i = 0$
172 $WHILE i < LENGTH(list)$
173 $ResultOfGetPropertyInfo = APPEND(ResultOfGetPropertyInfo, AT(list, i))$
174 $i = i + 1$
175 $END$
176
177 $RESULT = ResultOfGetPropertyInfo$
178$END$
Note: See TracBrowser for help on using the repository browser.