1 /*********************************************************************************
\r
3 * --------------------------------------------------------------------------------
\r
5 * This file is part of MiMic
\r
6 * Copyright (C)2011 Ryo Iizuka
\r
8 * MiMic is free software: you can redistribute it and/or modify
\r
9 * it under the terms of the GNU Lesser General Public License as published
\r
10 * by the Free Software Foundation, either version 3 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU Lesser General Public License
\r
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
21 * For further information please contact.
\r
23 * <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
\r
25 *********************************************************************************/
\r
26 #ifndef NYLPC_CNETCONFIG_H_
\r
27 #define NYLPC_CNETCONFIG_H_
\r
29 #include "NyLPC_stdlib.h"
\r
30 #include "NyLPC_uipService.h"
\r
33 #endif /* __cplusplus */
\r
34 #define NyLPC_cNetConfig_INTERFACE_TYPE_ETHERNET 1
\r
38 * NyLPC_cNetConfigクラスは、NyLPC_NetConfigの初期化データを保持します。
\r
39 * 初期化データのロード・セーブ機能を提供します。
\r
41 typedef struct NyLPC_TcNetConfig NyLPC_TcNetConfig_t;
\r
45 * NyLPC_TcFifoBufferクラスの構造体です。
\r
47 struct NyLPC_TcNetConfig
\r
50 NyLPC_TUInt16 version;
\r
52 NyLPC_TUInt16 interface_type;
\r
55 /** Ethernet mac address */
\r
56 NyLPC_TcIPv4Config_t ethernet;
\r
59 // struct NyLPC_TEthAddr mac_addr;
\r
65 * フラッシュメモリから設定値を読み出して、インスタンスを初期化します。
\r
66 * @param i_is_factory_default
\r
67 * 出荷時設定を読み出すかを設定します。
\r
69 void NyLPC_cNetConfig_initialize(NyLPC_TcNetConfig_t* i_inst,NyLPC_TBool i_is_factory_default);
\r
75 #define NyLPC_cNetConfig_finalize(i_inst);
\r
77 #define NyLPC_cNetConfig_setIpAddr(i_inst,ip1,ip2,ip3,ip4) NyLPC_TIPv4Addr_set(&((i_inst)->interface_setting.ethernet.ip_addr),(ip1),(ip2),(ip3),(ip4));
\r
80 * Set IPv4 network mask value to instance.
\r
82 #define NyLPC_cNetConfig_setNetMask(i_inst,ip1,ip2,ip3,ip4) NyLPC_TIPv4Addr_set(&((i_inst)->interface_setting.ethernet.netmask),(ip1),(ip2),(ip3),(ip4));
\r
85 * Set IPv4 default gateway address to instance.
\r
87 #define NyLPC_cNetConfig_setGateway(i_inst,ip1,ip2,ip3,ip4) NyLPC_TIPv4Addr_set(&((i_inst)->interface_setting.ethernet.dr_addr),(ip1),(ip2),(ip3),(ip4));
\r
90 * Set ethernet mac address to instance.
\r
92 #define NyLPC_cNetConfig_setEmac(i_inst,a1,a2,a3,a4,a5,a6) NyLPC_TEthAddr_set(&((i_inst)->interface_setting.ethernet.eth_mac),(a1),(a2),(a3),(a4),(a5),(a6));
\r
98 #endif /* __cplusplus */
\r
99 #endif /* NYLPC_CNETCONFIG_H_ */
\r