CTR Pia  4.11.3
Game Communication Engine
local_UdsSessionInfo.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: local_UdsSessionInfo.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/local/local_LocalSessionInfo.h>
18 #include <pia/local/local_UdsNetworkSetting.h>
19 
20 namespace nn
21 {
22 namespace pia
23 {
24 namespace local
25 {
26 
27 /*!
28  @brief Data class for local communication sessions.
29 */
31 {
32 public:
34  virtual ~UdsSessionInfo();
35 
36 /*!
37  @brief Copies session information.
38  @details Use this when you want the application to retain session information.
39  @param[in] rhs Session information to copy.
40 */
41  void Copy(UdsSessionInfo& rhs);
42 
43 /*!
44  @brief Clears session information.
45 */
46  virtual void Clear();
47 
48 /*!
49  @brief Gets the session's game mode.
50  @details A communication mode ID is cast as a <tt>u32</tt> argument and returned.
51  @return Returns the game mode.
52 */
53  virtual u32 GetGameMode() const;
54 
55 /*!
56  @brief Gets the session's ID.
57  @return Returns the session ID.
58 */
59  virtual u32 GetSessionId() const;
60 
61 /*!
62  @brief Gets the number of people participating in a session.
63  @return Returns the number of people participating in a session.
64 */
65  virtual u32 GetCurrentParticipants() const;
66 
67 /*!
68  @brief Gets the maximum number of people who can participate in a session.
69  @return Returns the maximum number of people who can participate in a session.
70 */
71  virtual u32 GetMaxParticipants() const;
72 
73 /*!
74  @brief Gets the session's application-defined data.
75  @details Gets the beacon data set by the application.
76  @param[out] pBuffer Pointer to the buffer for copying the session's application-defined data.
77  @param[in] size Specifies the size of the buffer required for copying the session's application-defined data.
78  @return Returns a <tt>Result</tt> value indicating success if information was successfully obtained.
79  @retval ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
80  @retval ResultInvalidState Not in a state where data can be retrieved. Programming error. Fix your program so that this error is not returned.
81  @if CTR_DOC
82  @retval ResultNoData There was no data to get. Handle appropriately in the application.
83  @endif
84 */
85  virtual nn::Result GetApplicationDataBuf(void* pBuffer, size_t size);
86 
87 /*!
88  @brief Gets the length of the session's application-defined data.
89  @param[out] pSize Pointer to the container for the length of the session's application-defined data.
90  @return Returns a <tt>Result</tt> value indicating success if information was successfully obtained.
91  @retval ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
92  @retval ResultInvalidState Not in a state where data can be retrieved. Programming error. Fix your program so that this error is not returned.
93 */
94  virtual nn::Result GetApplicationDataSize(size_t* pSize);
95 
96 
97 /*!
98  @brief Gets whether a session is open for recruitment.
99  @return Returns <tt>true</tt> if the session is open for recruitment, and returns <tt>false</tt> if it is closed.
100 */
101  virtual bool IsOpened() const;
102 
103 /*!
104  @if CTR_DOC
105  @brief Gets the information for stations currently participating in sessions.
106  @param[out] pSessionStationInfo Specifies a pointer to the station information container.
107  @return Returns a <tt>Result</tt> value indicating success if information was successfully obtained.
108  @retval ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
109  @retval ResultInvalidState Not in a state where data can be retrieved. Programming error. Fix your program so that this error is not returned.
110  @retval ResultNoData Indicates that information could not be obtained. Returned only during local communications. Handle appropriately in the application.
111  @retval ResultInvalidConnection Indicates that the device entered wireless off mode. You must restart. Returned only during local communications. Perform cleanup.
112  @endif
113 */
114  virtual nn::Result GetSessionStationInfo(session::SessionStationInfo* pSessionStationInfo) const;
115 
116 /*!
117  @if CTR_DOC
118  @brief Gets the BSSID (the host's MAC address).
119  @details The size of the BSSID is <tt>nn::uds::MAC_ADDRESS_SIZE</tt> bytes. Set a buffer of this size in the parameter.
120  @param[out] pBssidBuffer Buffer that stores the BSSID. The size must be <tt>nn::uds::MAC_ADDRESS_SIZE</tt> bytes.
121  @return Returns a <tt>Result</tt> value indicating success if information was successfully obtained.
122  @retval ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
123  @retval ResultInvalidState Not in a state where data can be retrieved. Programming error. Fix your program so that this error is not returned.
124  @endif
125 */
126  virtual nn::Result GetBssid(bit8* pBssidBuffer) const;
127 
128 /*!
129  @brief Prints information that is useful for debugging.
130  @param[in] flag Specifies the bitwise OR of trace flags. For more information, see the <tt>@ref TraceFlag</tt> API reference.
131 */
132  virtual void Trace(u64 flag);
133 
134  //! @cond PRIVATE
135  virtual const LocalNetworkDescription* GetLocalNetworkDescription() const;
136  virtual void SetLocalNetworkDescription(LocalNetworkDescription* pDescription);
137 
138  virtual void SetSessionStationInfo(u32 index);
139  //! @endcond
140 
141 private:
142  UdsNetworkDescription m_UdsNetworkDescription;
143  UdsStationInfo m_UdsStationInfoArray[STATION_MAX_ENTRY];
144 };
145 }
146 }
147 } // End of namespace nn::pia::local.
void Copy(UdsSessionInfo &rhs)
Copies session information.
virtual nn::Result GetApplicationDataSize(size_t *pSize)
Gets the length of the session&#39;s application-defined data.
virtual nn::Result GetBssid(bit8 *pBssidBuffer) const
Gets the BSSID (the host&#39;s MAC address).
static const u8 STATION_MAX_ENTRY
The maximum number of nodes that can connect. The local network host is included in the number of con...
Definition: local_LocalNetworkSetting.h:33
Definition: assert.h:115
virtual void Clear()
Clears session information.
virtual u32 GetCurrentParticipants() const
Gets the number of people participating in a session.
Class that holds information about stations that are connected to a network that uses the UDS library...
Definition: local_UdsNetworkSetting.h:330
virtual void Trace(u64 flag)
Prints information that is useful for debugging.
Represents information about a station that is participating in a session.
Definition: session_SessionStationInfo.h:31
virtual nn::Result GetApplicationDataBuf(void *pBuffer, size_t size)
Gets the session&#39;s application-defined data.
virtual u32 GetGameMode() const
Gets the session&#39;s game mode.
virtual u32 GetSessionId() const
Gets the session&#39;s ID.
virtual nn::Result GetSessionStationInfo(session::SessionStationInfo *pSessionStationInfo) const
Gets the information for stations currently participating in sessions.
Data class for local communication sessions.
Definition: local_UdsSessionInfo.h:30
Data class for local communication sessions.
Definition: local_LocalSessionInfo.h:43
Class that holds information about networks that use the UDS library.
Definition: local_UdsNetworkSetting.h:110
Class that holds information about a local network.
Definition: local_LocalNetworkSetting.h:121
virtual u32 GetMaxParticipants() const
Gets the maximum number of people who can participate in a session.
virtual bool IsOpened() const
Gets whether a session is open for recruitment.