1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     uds_ScanResultReader.h
4 
5   Copyright (C)2009 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 22589 $
14  *---------------------------------------------------------------------------*/
15 
16 /*! @file
17     @brief    スキャン結果の解析用クラスを定義します。
18 */
19 
20 #ifndef LIBRARIES_UDS_CTR_UDS_SCAN_RESULT_READER_H_
21 #define LIBRARIES_UDS_CTR_UDS_SCAN_RESULT_READER_H_
22 
23 #include <nn.h>
24 
25 #include <nn/uds/CTR/uds_Type.h>
26 #include <nn/uds/CTR/uds_Result.h>
27 #include <nn/uds/CTR/uds_InfoElement.h>
28 #include <nn/uds/CTR/uds_NetworkDescription.h>
29 
30 namespace nn {
31 namespace uds {
32 namespace CTR {
33 
34 /*!
35   @name  @ref nn::uds::Scan 関連
36   @{
37 */
38 
39 /*!
40     @class nn::uds::CTR::NetworkDescriptionReader
41     @brief @ref nn::uds::CTR::ScanResultReader から取得出来る、各ネットワークの情報を解析するクラスです。
42 */
43 class NetworkDescriptionReader
44 {
45 public:
NetworkDescriptionReader(const u8 * pBuffer)46     NetworkDescriptionReader(const u8* pBuffer):m_pBuffer(pBuffer){}
~NetworkDescriptionReader()47     virtual ~NetworkDescriptionReader() {}
48 
49 /*!
50   @brief        スキャン結果からネットワーク情報を取得します。
51 
52   @param[out]   pNetworkDescription  ネットワーク情報の格納先です。データは正しくネットワーク情報を取得できた場合のみ格納されます。
53   @return       関数の実行結果を返します。
54 */
55     nn::Result GetNetworkDescription ( NetworkDescription* pNetworkDescription );
56 
57 /*!
58   @brief        スキャン結果からネットワークに接続しているノードのユーザー情報を取得します。
59 
60   @param[out]   pNodeInfo ユーザー情報の格納です。そのネットワークの最大接続数分の配列を指定してください。データは正しくユーザー情報を取得できた場合のみ格納されます。
61   @return       関数の実行結果を返します。
62 */
63     nn::Result GetNodeInformationList( NodeInformation pNodeInfo[NODE_MAX] );
64 
65 /*!
66   @brief        ネットワークから送信された電波の強度を リンクレベル換算で取得します。
67 
68   @param[out]   pLinkLevel 電波強度の格納先です。
69   @return       関数の実行結果を返します。
70 */
71     nn::Result GetRadioStrength( LinkLevel* pLinkLevel );
72 private:
73     const u8* m_pBuffer;
74 };
75 
76 /*!
77 
78     @class nn::uds::CTR::ScanResultReader
79     @brief @ref nn::uds::CTR::Scan の探索結果を解析するクラスです。
80 */
81 class ScanResultReader
82 {
83 public:
84 /*!
85   @brief        引数で与えたれた探索結果を解析する インスタンスを生成します。
86   @param[in]    pBuffer 探索結果のポインタです。@ref nn::uds::CTR::Scan に与えたバッファを指定してください。
87   @return       なし
88 */
ScanResultReader(const void * pBuffer)89     ScanResultReader(const void* pBuffer) : m_pBuffer(pBuffer), m_pNext(NULL){}
~ScanResultReader()90     virtual ~ScanResultReader() {}
91 
92 
93     u32   GetCount() const;                                 //!< 見つかったネットワークの数をカウントします。
94     const NetworkDescriptionReader GetFirstDescription();  //!< 最初に見つかったネットワークを @ref nn::uds::CTR::NetworkDescriptionReader で取得します。
95     const NetworkDescriptionReader GetNextDescription(); //!< 次に見つかったネットワークを @ref nn::uds::CTR::NetworkDescriptionReader で取得します。
96 private:
97     const void* m_pBuffer;
98     bit8*       m_pNext;
99 };
100 
101 /*!
102   @}
103 */
104 } // end of namespace CTR
105 } // end of namespace uds
106 } // end of namespace nn
107 
108 #endif /* LIBRARIES_UDS_CTR_UDS_SCAN_RESULT_READER_H_ */
109