source: uKadecot/trunk/src/ukadecot/main.h@ 101

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

TOPPERS/uKadecotのソースコードを追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/plain
File size: 5.6 KB
Line 
1/*
2 * TOPPERS ECHONET Lite Communication Middleware
3 *
4 * Copyright (C) 2014 Cores Co., Ltd. Japan
5 *
6 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
7 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
8 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
9 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
10 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
11 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
12 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
13 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
14ƒƒ“ƒgi—˜—p
15 * ŽÒƒ}ƒjƒ…
16ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
17 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
18 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
19 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
20 * ‚ƁD
21 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
22ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
23ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
24 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
25 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
26 * •ñ‚·‚邱‚ƁD
27 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
28 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
29 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
30 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
31 * –Ɛӂ·‚邱‚ƁD
32 *
33 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
34 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
35 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
36 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
37 * ‚̐ӔC‚𕉂í‚È‚¢D
38 *
39 * @(#) $Id: main.h 101 2015-06-02 15:37:23Z coas-nagasima $
40 */
41
42#ifndef _MAIN_H_
43#define _MAIN_H_
44
45/*
46 * ƒTƒ“ƒvƒ‹ƒvƒƒOƒ‰ƒ€(1)‚̃wƒbƒ_ƒtƒ@ƒCƒ‹
47 */
48
49/*
50 * ƒ^[ƒQƒbƒgˆË‘¶‚Ì’è‹`
51 */
52#include <kernel.h>
53#include "target_config.h"
54#include "echonet.h"
55#include "echonet_fbs.h"
56
57/*
58 * Šeƒ^ƒXƒN‚Ì—Dæ“x‚Ì’è‹`
59 */
60
61#define MAIN_PRIORITY 7 /* ƒƒCƒ“ƒ^ƒXƒN‚Ì—Dæ“x */
62#define INIT_PRIORITY 1 /* ‰Šú‰»ƒ^ƒXƒN‚Ì—Dæ“x */
63#define LOGTASK_PRIORITY 8 /* ƒƒOƒ^ƒXƒN‚Ì—Dæ“x */
64
65#define MAIN_STACK_SIZE 1024 /* ƒXƒ^ƒbƒN—̈æ‚̃TƒCƒY */
66
67#define EOJ_X3_LOCAL_NODE 1 /* ƒm[ƒhƒvƒƒtƒ@ƒCƒ‹ƒIƒuƒWƒFƒNƒg‚̃Cƒ“ƒXƒ^ƒ“ƒXƒR[ƒh */
68
69#define EOJ_X3_CONTROLLER 1 /* ƒRƒ“ƒgƒ[ƒ‰[ƒNƒ‰ƒX‚̃Cƒ“ƒXƒ^ƒ“ƒXƒR[ƒh */
70
71#define NUM_WEBSOCKET_MBXID 2
72
73/*
74 * ŠÖ”‚̃vƒƒgƒ^ƒCƒvéŒ¾
75 */
76#ifndef TOPPERS_MACRO_ONLY
77
78extern void main_task(intptr_t exinf);
79extern void main_task_cychdr(intptr_t exinf);
80
81#ifdef __CA850__
82#pragma pack(1)
83#elif __RX
84#pragma pack
85#elif _MSC_VER
86#pragma pack(push, 1)
87#endif
88
89/*
90 * ‚u‚…
91‚’‚“‚‰‚‚Žî•ñ‚ÌŒ^
92 */
93struct version_information_t {
94 /* ƒƒWƒƒ[ƒo[ƒWƒ‡ƒ“(¬”“_ˆÈã) */
95 uint8_t major_version_number;
96 /* ƒ}ƒCƒi[ƒo[ƒWƒ‡ƒ“(¬”“_ˆÈ‰º) */
97 uint8_t minor_version_number;
98 /* “d•¶ƒ^ƒCƒv */
99 uint8_t message_type[2];
100};
101
102/*
103 * ƒ[ƒJ[ƒR[ƒh‚ÌŒ^
104 */
105struct manufacturer_code_t {
106 /* ƒ[ƒJ[ƒR[ƒh */
107 uint8_t manufacturer_code[3];
108};
109
110/*
111 * Ž¯•Ê”ԍ†‚ÌŒ^
112 */
113struct node_identification_number_t {
114 /* ‰ºˆÊ’ʐM‘wIDƒtƒB[ƒ‹ƒh */
115 uint8_t lower_communication_id_field;
116 /* ƒ[ƒJ[ƒR[ƒh */
117 struct manufacturer_code_t manufacturer_code;
118 /* ƒ†ƒj[ƒNID•”(ƒ[ƒJ[“ÆŽ©) */
119 uint8_t unique_id_section[13];
120};
121
122/*
123 * ‹KŠi‚u‚…
124‚’‚“‚‰‚‚Žî•ñ‚ÌŒ^
125 */
126struct standard_version_information_t {
127 /* ΁Տ1(for future reserved) */
128 uint8_t reserved1;
129 /* ΁Տ2(for future reserved) */
130 uint8_t reserved2;
131 /* ƒŠƒŠ[ƒX‡‚ðASCII‚ÅŽ¦‚· */
132 uint8_t order_of_release;
133 /* ΁Տ4(for future reserved) */
134 uint8_t reserved4;
135};
136
137/*
138 * ƒm[ƒhƒvƒƒtƒ@ƒCƒ‹ƒIƒuƒWƒFƒNƒg
139 */
140struct node_profile_object_t {
141 /* “®ìó‘Ô */
142 uint8_t operation_status;
143 /* ‚u‚…
144‚’‚“‚‰‚‚Žî•ñ */
145 struct version_information_t version_information;
146 /* Ž¯•Ê”ԍ† */
147 struct node_identification_number_t identification_number;
148 /* ˆÙí“à—e */
149 uint16_t fault_content;
150 /* ƒ[ƒJ[ƒR[ƒh */
151 struct manufacturer_code_t manufacturer_code;
152};
153
154/*
155 * ƒRƒ“ƒgƒ[ƒ‰[ƒNƒ‰ƒX
156 */
157struct controller_t {
158 /* “®ìó‘Ô */
159 uint8_t operation_status;
160 /* Ý’uêŠ */
161 uint8_t installation_location;
162 /* ‹KŠi‚u‚…
163‚’‚“‚‰‚‚Žî•ñ */
164 struct standard_version_information_t standard_version_information;
165 /* ˆÙí”­¶ó‘Ô */
166 uint8_t fault_status;
167 /* ƒ[ƒJ[ƒR[ƒh */
168 struct manufacturer_code_t manufacturer_code;
169};
170
171#ifdef __CA850__
172#pragma pack(8)
173#elif __RX
174#pragma unpack
175#elif _MSC_VER
176#pragma pack(pop)
177#endif
178
179extern struct node_profile_object_t local_node_data; /* ƒm[ƒhƒvƒƒtƒ@ƒCƒ‹ƒIƒuƒWƒFƒNƒg‚̃f[ƒ^ */
180
181extern struct controller_t controller_class_data; /* ƒRƒ“ƒgƒ[ƒ‰[ƒNƒ‰ƒX‚̃f[ƒ^ */
182
183EPRP_SETTER onoff_prop_set;
184EPRP_SETTER node_profile_object_fault_content_set;
185EPRP_SETTER alarm_prop_set;
186EPRP_SETTER time_prop_set;
187EPRP_GETTER time_prop_get;
188EPRP_SETTER date_prop_set;
189EPRP_GETTER date_prop_get;
190
191ER main_send_message(ECN_FBS_ID buf, ID wbsid);
192ER main_get_device_list(unsigned int requestId, struct wamp_dealer *dealer);
193ER main_get_device_ipaddr(unsigned int requestId, struct wamp_dealer *dealer, ECN_ENOD_ID addrid);
194ER main_get_device_info(unsigned int requestId, struct wamp_dealer *dealer, ID eobjid);
195ER main_kadecot_get(unsigned int requestId, struct wamp_dealer *dealer, ID eobjid, uint8_t epc);
196ER main_kadecot_set(unsigned int requestId, struct wamp_dealer *dealer, ID eobjid, uint8_t epc,
197 uint8_t pdc, uint8_t *edt);
198ER main_ecnl_get(unsigned int requestId, struct wamp_dealer *dealer, ID eobjid, T_EDATA *esv);
199ER main_ecnl_set(unsigned int requestId, struct wamp_dealer *dealer, ID eobjid, T_EDATA *esv);
200ER main_ecnl_setget(unsigned int requestId, struct wamp_dealer *dealer, ID eobjid, T_EDATA *esv);
201
202#endif /* TOPPERS_MACRO_ONLY */
203
204#endif /* of #ifndef _MAIN_H_ */
Note: See TracBrowser for help on using the repository browser.