CTR Pia  4.11.3
Game Communication Engine
local_LocalSessionInfo.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: local_LocalSessionInfo.h
4 
5  Copyright Nintendo. 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 
14 
15 #pragma once
16 
17 #include <pia/session/session_ISessionInfo.h>
18 
19 namespace nn
20 {
21 namespace pia
22 {
23 namespace session
24 {
25 // Forward declarations.
26 class SessionStationInfo;
27 }
28 }
29 }
30 
31 namespace nn
32 {
33 namespace pia
34 {
35 namespace local
36 {
37 
38 class LocalNetworkDescription;
39 
40 /*!
41  @brief Data class for local communication sessions.
42 */
44 {
45 public:
47  virtual ~LocalSessionInfo();
48 
49 /*!
50  @brief Gets the minimum number of people who can participate in a session.
51  @return Returns the minimum number of people who can participate in a session.
52 */
53  virtual u32 GetMinParticipants() const;
54 
55 /*!
56  @brief Gets the session's application-defined data.
57  @details Gets the beacon data set by the application.
58  @param[out] pBuffer Pointer to the buffer for copying the session's application-defined data.
59  @param[in] size Specifies the size of the buffer required for copying the session's application-defined data.
60  @return Returns a <tt>Result</tt> value indicating success if information was successfully obtained.
61  @retval ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
62  @retval ResultInvalidState Not in a state where data can be retrieved. Programming error. Fix your program so that this error is not returned.
63  @if CTR_DOC
64  @retval ResultNoData There was no data to get. Handle appropriately in the application.
65  @endif
66 */
67  virtual nn::Result GetApplicationDataBuf(void* pBuffer, size_t size) = 0;
68 
69 /*!
70  @brief Gets the length of the session's application-defined data.
71  @param[out] pSize Pointer to the container for the length of the session's application-defined data.
72  @return Returns a <tt>Result</tt> value indicating success if information was successfully obtained.
73  @retval ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
74  @retval ResultInvalidState Not in a state where data can be retrieved. Programming error. Fix your program so that this error is not returned.
75 */
76  virtual nn::Result GetApplicationDataSize(size_t* pSize) = 0;
77 
78 /*!
79  @if CTR_DOC
80  @brief Gets the session's signal strength.
81  @param[out] pRadioStrength Pointer to the signal strength container.
82  @return Returns a <tt>Result</tt> value indicating success if information was successfully obtained.
83  @retval ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
84  @retval ResultInvalidState Not in a state where data can be retrieved. Programming error. Fix your program so that this error is not returned.
85  @endif
86 */
87  virtual nn::Result GetRadioStrength(u8* pRadioStrength) const;
88 
89 /*!
90  @if CTR_DOC
91  @brief Gets the information for stations currently participating in sessions.
92  @details Succeeds only when local communication is ongoing.
93  @param[out] pSessionStationInfo Specifies a pointer to the station information container.
94  @return Returns a <tt>Result</tt> value indicating success if information was successfully obtained.
95  @retval ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
96  @retval ResultInvalidState Not in a state where data can be retrieved. Programming error. Fix your program so that this error is not returned.
97  @retval ResultNoData Indicates that information could not be obtained. Returned only during local communications. Handle appropriately in the application.
98  @retval ResultInvalidConnection Indicates that the device entered wireless off mode. You must restart. Returned only during local communications. Perform cleanup.
99  @endif
100 */
101  virtual nn::Result GetSessionStationInfo(session::SessionStationInfo* pSessionStationInfo) const = 0;
102 
103 /*!
104  @if CTR_DOC
105  @brief Gets the BSSID (the host's MAC address).
106  @details The size of the BSSID is <tt>nn::uds::MAC_ADDRESS_SIZE</tt> bytes. Set a buffer of this size in the parameter.
107  @param[out] pBssidBuffer Buffer that stores the BSSID. The size must be <tt>nn::uds::MAC_ADDRESS_SIZE</tt> bytes.
108  @return Returns a <tt>Result</tt> value indicating success if information was successfully obtained.
109  @retval ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
110  @retval ResultInvalidState Not in a state where data can be retrieved. Programming error. Fix your program so that this error is not returned.
111  @endif
112 */
113  virtual nn::Result GetBssid(bit8* pBssidBuffer) const = 0;
114 
115 /*!
116  @brief Clears session information.
117 */
118  virtual void Clear();
119 
120  //! @cond PRIVATE
121  virtual const LocalNetworkDescription* GetLocalNetworkDescription() const = 0;
122  virtual void SetLocalNetworkDescription(LocalNetworkDescription* pDescription) = 0;
123  void SetRadioStrength(u32 index); // <tt>index</tt> is the index when performing a network search.
124  virtual void SetSessionStationInfo(u32 index) = 0; // <tt>index</tt> is the index when performing a network search.
125  //! @endcond
126 
127 protected:
128  bool m_IsNetworkDescriptionSet;
129  u8 m_RadioStrength;
130 };
131 }
132 }
133 } // End of namespace nn::pia::local.
Definition: assert.h:115
An interface to the session&#39;s information.
Definition: session_ISessionInfo.h:32
Represents information about a station that is participating in a session.
Definition: session_SessionStationInfo.h:31
Data class for local communication sessions.
Definition: local_LocalSessionInfo.h:43
Class that holds information about a local network.
Definition: local_LocalNetworkSetting.h:121