OSDN Git Service

update libMiMic
[mimic/MiMicSDK.git] / lib / src / net / httpd / mod / NyLPC_cModUPnPDevice.h
1 /*********************************************************************************\r
2  * PROJECT: MiMic\r
3  * --------------------------------------------------------------------------------\r
4  *\r
5  * This file is part of MiMic\r
6  * Copyright (C)2011 Ryo Iizuka\r
7  *\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
12  *\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
17  *\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
20  *\r
21  * For further information please contact.\r
22  *  http://nyatla.jp/\r
23  *  <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
24  *\r
25  *********************************************************************************/\r
26 #ifndef NYLPC_CMODUPNPDEVICE_H_\r
27 #define NYLPC_CMODUPNPDEVICE_H_\r
28 \r
29 #include "../../upnp/NyLPC_cUPnP.h"\r
30 #include "NyLPC_cModRomFiles.h"\r
31 \r
32 #include "NyLPC_stdlib.h"\r
33 #include "NyLPC_http.h"\r
34 \r
35 \r
36 #ifdef __cplusplus\r
37 extern "C" {\r
38 #endif /* __cplusplus */\r
39 /**\r
40  * NyLPC_cUPnPクラスと協調して、UPnPDeviceのHTTP接続を処理します。\r
41  * 提供するサービスは以下の通りです。\r
42  * <ul>\r
43  * <li>DeviceDescription - /[:i_path:]/ddesc</li>\r
44  * <li>CONTROL - /[:i_path:]/control/[:serviceIndex:]</li>\r
45  * <li>EVENT - /[:i_path:]/control/[:serviceIndex:]</li>\r
46  * </ul>\r
47  * [:serviceIndex:]はdeviceDescriptionを直列化して生成する通し番号です。\r
48  * サービスを示す一意のIDです。16BITのHEX値です。\r
49  * 上位8bitがデバイスインデックス、下位8bitがサービスインデックスです。\r
50  * 例えば以下の構造のデバイスでは、サービス番号は以下のようになります。\r
51  * <pre>\r
52  * dev:a        0x1n (0<=n<=0xf)\r
53  *  +-dev:b     0x2n (0<=n<=0xf)\r
54  *  |+-dev:c    0x3n (0<=n<=0xf)\r
55  *  +-dev:d     0x4n (0<=n<=0xf)\r
56  * </pre>\r
57  */\r
58 typedef struct NyLPC_TcModUPnPDevice NyLPC_TcModUPnPDevice_t;\r
59 \r
60 struct NyLPC_TcModUPnPDevice\r
61 {\r
62     NyLPC_TcModRomFiles_t super;\r
63     const NyLPC_TcUPnP_t* _ref_upnp;\r
64 };\r
65 \r
66 /**\r
67  * コンストラクタ\r
68  * @param i_inst\r
69  * 初期化するインスタンスのポインタ\r
70  * @param i_ref_upnp\r
71  * 参照するUPnPデバイスインスタンス\r
72  *\r
73  */\r
74 void NyLPC_cModUPnPDevice_initialize(NyLPC_TcModUPnPDevice_t* i_inst,const NyLPC_TcUPnP_t* i_ref_upnp);\r
75 \r
76 /**\r
77  *\r
78  */\r
79 void NyLPC_cModUPnPDevice_finalize(NyLPC_TcModUPnPDevice_t* i_inst);\r
80 \r
81 /**\r
82  * モジュールがコネクションをハンドリングできるかを返します。\r
83  */\r
84 NyLPC_TBool NyLPC_cModUPnPDevice_canHandle(NyLPC_TcModUPnPDevice_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection);\r
85 \r
86 \r
87 \r
88 /**\r
89  * モジュールを実行します。\r
90  */\r
91 NyLPC_TBool NyLPC_cModUPnPDevice_execute(NyLPC_TcModUPnPDevice_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection);\r
92 \r
93 #ifdef __cplusplus\r
94 }\r
95 #endif /* __cplusplus */\r
96 #endif\r