1 | /*
|
---|
2 | * TOPPERS ECHONET Lite Communication Middleware
|
---|
3 | *
|
---|
4 | * Copyright (C) 2014 Cores Co., Ltd. Japan
|
---|
5 | *
|
---|
6 | * 上記著作権者は,以下の(1)〜(4)の条件を満たす場合に限り,本ソフトウェ
|
---|
7 | * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
|
---|
8 | * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
|
---|
9 | * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
---|
10 | * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
---|
11 | * スコード中に含まれていること.
|
---|
12 | * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
---|
13 | * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
---|
14 | * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
---|
15 | * の無保証規定を掲載すること.
|
---|
16 | * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
---|
17 | * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
|
---|
18 | * と.
|
---|
19 | * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
---|
20 | * 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
---|
21 | * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
|
---|
22 | * 報告すること.
|
---|
23 | * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
---|
24 | * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
---|
25 | * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
|
---|
26 | * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
|
---|
27 | * 免責すること.
|
---|
28 | *
|
---|
29 | * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
---|
30 | * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
|
---|
31 | * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
|
---|
32 | * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
|
---|
33 | * の責任を負わない.
|
---|
34 | *
|
---|
35 | * @(#) $Id: main.h 152 2016-01-14 04:17:21Z coas-nagasima $
|
---|
36 | */
|
---|
37 |
|
---|
38 | #ifndef _MAIN_H_
|
---|
39 | #define _MAIN_H_
|
---|
40 |
|
---|
41 | /*
|
---|
42 | * サンプルプログラム(1)のヘッダファイル
|
---|
43 | */
|
---|
44 |
|
---|
45 | /*
|
---|
46 | * ターゲット依存の定義
|
---|
47 | */
|
---|
48 | #include <kernel.h>
|
---|
49 | #include "target_config.h"
|
---|
50 | #include "echonet.h"
|
---|
51 | #include "echonet_fbs.h"
|
---|
52 |
|
---|
53 | /*
|
---|
54 | * 各タスクの優先度の定義
|
---|
55 | */
|
---|
56 |
|
---|
57 | #define MAIN_PRIORITY 3 /* メインタスクの優先度 */
|
---|
58 | #define INIT_PRIORITY 1 /* 初期化タスクの優先度 */
|
---|
59 | #define LOGTASK_PRIORITY 8 /* ログタスクの優先度 */
|
---|
60 |
|
---|
61 | #define MAIN_STACK_SIZE 1024 /* スタック領域のサイズ */
|
---|
62 |
|
---|
63 | #define EOJ_X3_LOCAL_NODE 1 /* ノードプロファイルオブジェクトのインスタンスコード */
|
---|
64 |
|
---|
65 | #define EOJ_X3_CONTROLLER 1 /* コントローラークラスのインスタンスコード */
|
---|
66 |
|
---|
67 | #define NUM_WEBSOCKET_MBXID 2
|
---|
68 |
|
---|
69 | /*
|
---|
70 | * 関数のプロトタイプ宣言
|
---|
71 | */
|
---|
72 | #ifndef TOPPERS_MACRO_ONLY
|
---|
73 |
|
---|
74 | extern void main_task(intptr_t exinf);
|
---|
75 | extern void main_task_cychdr(intptr_t exinf);
|
---|
76 |
|
---|
77 | #ifdef __CA850__
|
---|
78 | #pragma pack(1)
|
---|
79 | #elif __RX
|
---|
80 | #pragma pack
|
---|
81 | #elif _MSC_VER
|
---|
82 | #pragma pack(push, 1)
|
---|
83 | #endif
|
---|
84 |
|
---|
85 | /*
|
---|
86 | * Version情報の型
|
---|
87 | */
|
---|
88 | struct version_information_t {
|
---|
89 | /* メジャーバージョン(小数点以上) */
|
---|
90 | uint8_t major_version_number;
|
---|
91 | /* マイナーバージョン(小数点以下) */
|
---|
92 | uint8_t minor_version_number;
|
---|
93 | /* 電文タイプ */
|
---|
94 | uint8_t message_type[2];
|
---|
95 | };
|
---|
96 |
|
---|
97 | /*
|
---|
98 | * メーカーコードの型
|
---|
99 | */
|
---|
100 | struct manufacturer_code_t {
|
---|
101 | /* メーカーコード */
|
---|
102 | uint8_t manufacturer_code[3];
|
---|
103 | };
|
---|
104 |
|
---|
105 | /*
|
---|
106 | * 識別番号の型
|
---|
107 | */
|
---|
108 | struct node_identification_number_t {
|
---|
109 | /* 下位通信層IDフィールド */
|
---|
110 | uint8_t lower_communication_id_field;
|
---|
111 | /* メーカーコード */
|
---|
112 | struct manufacturer_code_t manufacturer_code;
|
---|
113 | /* ユニークID部(メーカー独自) */
|
---|
114 | uint8_t unique_id_section[13];
|
---|
115 | };
|
---|
116 |
|
---|
117 | /*
|
---|
118 | * 規格Version情報の型
|
---|
119 | */
|
---|
120 | struct standard_version_information_t {
|
---|
121 | /* 固定1(for future reserved) */
|
---|
122 | uint8_t reserved1;
|
---|
123 | /* 固定2(for future reserved) */
|
---|
124 | uint8_t reserved2;
|
---|
125 | /* リリース順をASCIIで示す */
|
---|
126 | uint8_t order_of_release;
|
---|
127 | /* 固定4(for future reserved) */
|
---|
128 | uint8_t reserved4;
|
---|
129 | };
|
---|
130 |
|
---|
131 | /*
|
---|
132 | * ノードプロファイルオブジェクト
|
---|
133 | */
|
---|
134 | struct node_profile_object_t {
|
---|
135 | /* 動作状態 */
|
---|
136 | uint8_t operation_status;
|
---|
137 | /* Version情報 */
|
---|
138 | struct version_information_t version_information;
|
---|
139 | /* 識別番号 */
|
---|
140 | struct node_identification_number_t identification_number;
|
---|
141 | /* 異常内容 */
|
---|
142 | uint16_t fault_content;
|
---|
143 | /* メーカーコード */
|
---|
144 | struct manufacturer_code_t manufacturer_code;
|
---|
145 | };
|
---|
146 |
|
---|
147 | /*
|
---|
148 | * コントローラークラス
|
---|
149 | */
|
---|
150 | struct controller_t {
|
---|
151 | /* 動作状態 */
|
---|
152 | uint8_t operation_status;
|
---|
153 | /* 設置場所 */
|
---|
154 | uint8_t installation_location;
|
---|
155 | /* 規格Version情報 */
|
---|
156 | struct standard_version_information_t standard_version_information;
|
---|
157 | /* 異常発生状態 */
|
---|
158 | uint8_t fault_status;
|
---|
159 | /* メーカーコード */
|
---|
160 | struct manufacturer_code_t manufacturer_code;
|
---|
161 | };
|
---|
162 |
|
---|
163 | #ifdef __CA850__
|
---|
164 | #pragma pack(8)
|
---|
165 | #elif __RX
|
---|
166 | #pragma unpack
|
---|
167 | #elif _MSC_VER
|
---|
168 | #pragma pack(pop)
|
---|
169 | #endif
|
---|
170 |
|
---|
171 | extern struct node_profile_object_t local_node_data; /* ノードプロファイルオブジェクトのデータ */
|
---|
172 |
|
---|
173 | extern struct controller_t controller_class_data; /* コントローラークラスのデータ */
|
---|
174 |
|
---|
175 | EPRP_SETTER onoff_prop_set;
|
---|
176 | EPRP_SETTER node_profile_object_fault_content_set;
|
---|
177 | EPRP_SETTER alarm_prop_set;
|
---|
178 | EPRP_SETTER time_prop_set;
|
---|
179 | EPRP_GETTER time_prop_get;
|
---|
180 | EPRP_SETTER date_prop_set;
|
---|
181 | EPRP_GETTER date_prop_get;
|
---|
182 |
|
---|
183 | ER main_send_message(ECN_FBS_ID buf, ID wbsid);
|
---|
184 | ER main_get_device_list(unsigned int requestId, struct wamp_dealer *dealer);
|
---|
185 | ER main_get_device_ipaddr(unsigned int requestId, struct wamp_dealer *dealer, ECN_ENOD_ID addrid);
|
---|
186 | ER main_get_device_info(unsigned int requestId, struct wamp_dealer *dealer, ID eobjid);
|
---|
187 | ER main_kadecot_get(unsigned int requestId, struct wamp_dealer *dealer, ID eobjid, uint8_t epc);
|
---|
188 | ER main_kadecot_set(unsigned int requestId, struct wamp_dealer *dealer, ID eobjid, uint8_t epc,
|
---|
189 | uint8_t pdc, uint8_t *edt);
|
---|
190 | ER main_ecnl_get(unsigned int requestId, struct wamp_dealer *dealer, ID eobjid, T_EDATA *esv);
|
---|
191 | ER main_ecnl_set(unsigned int requestId, struct wamp_dealer *dealer, ID eobjid, T_EDATA *esv);
|
---|
192 | ER main_ecnl_setget(unsigned int requestId, struct wamp_dealer *dealer, ID eobjid, T_EDATA *esv);
|
---|
193 | ER main_add_threshold(int subscriptionId, int pinno, uint16_t threshold);
|
---|
194 | ER main_del_threshold(int subscriptionId);
|
---|
195 |
|
---|
196 | #endif /* TOPPERS_MACRO_ONLY */
|
---|
197 |
|
---|
198 | #endif /* of #ifndef _MAIN_H_ */
|
---|