diff options
| author | 2017-03-13 22:21:01 -0500 | |
|---|---|---|
| committer | 2017-03-26 08:17:52 -0500 | |
| commit | 4243c1198ff960bcf5cfaaf38cc5cc1689a2bafd (patch) | |
| tree | 83be4863a987dc2a92f3c1da995366fc9675c7d9 /src | |
| parent | Services/UDS: Initial support for hosting local-wlan networks. (diff) | |
| download | yuzu-4243c1198ff960bcf5cfaaf38cc5cc1689a2bafd.tar.gz yuzu-4243c1198ff960bcf5cfaaf38cc5cc1689a2bafd.tar.xz yuzu-4243c1198ff960bcf5cfaaf38cc5cc1689a2bafd.zip | |
Services/UDS: Store the entire NetworkInfo structure that was used to create the network.
It will be needed when generating the beacon frames.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/nwm/nwm_uds.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/core/hle/service/nwm/nwm_uds.cpp b/src/core/hle/service/nwm/nwm_uds.cpp index 789476418..b69c90ef1 100644 --- a/src/core/hle/service/nwm/nwm_uds.cpp +++ b/src/core/hle/service/nwm/nwm_uds.cpp | |||
| @@ -38,11 +38,8 @@ static std::unordered_map<u32, Kernel::SharedPtr<Kernel::Event>> bind_node_event | |||
| 38 | // Since we're not actually interacting with physical radio waves, this is just a dummy value. | 38 | // Since we're not actually interacting with physical radio waves, this is just a dummy value. |
| 39 | static u8 network_channel = DefaultNetworkChannel; | 39 | static u8 network_channel = DefaultNetworkChannel; |
| 40 | 40 | ||
| 41 | // The identifier of the network kind, this is used to filter away networks that we're not interested in. | 41 | // Information about the network that we're currently connected to. |
| 42 | static u32 wlan_comm_id = 0; | 42 | static NetworkInfo network_info; |
| 43 | |||
| 44 | // Application data that is sent when broadcasting the beacon frames. | ||
| 45 | static std::vector<u8> application_data; | ||
| 46 | 43 | ||
| 47 | /** | 44 | /** |
| 48 | * NWM_UDS::Shutdown service function | 45 | * NWM_UDS::Shutdown service function |
| @@ -244,12 +241,10 @@ static void BeginHostingNetwork(Interface* self) { | |||
| 244 | 241 | ||
| 245 | LOG_DEBUG(Service_NWM, "called"); | 242 | LOG_DEBUG(Service_NWM, "called"); |
| 246 | 243 | ||
| 247 | NetworkInfo network_info; | ||
| 248 | Memory::ReadBlock(network_info_address, &network_info, sizeof(NetworkInfo)); | 244 | Memory::ReadBlock(network_info_address, &network_info, sizeof(NetworkInfo)); |
| 249 | 245 | ||
| 250 | connection_status.status = static_cast<u32>(NetworkStatus::ConnectedAsHost); | 246 | connection_status.status = static_cast<u32>(NetworkStatus::ConnectedAsHost); |
| 251 | connection_status.max_nodes = network_info.max_nodes; | 247 | connection_status.max_nodes = network_info.max_nodes; |
| 252 | wlan_comm_id = network_info.wlan_comm_id; | ||
| 253 | 248 | ||
| 254 | // There's currently only one node in the network (the host). | 249 | // There's currently only one node in the network (the host). |
| 255 | connection_status.total_nodes = 1; | 250 | connection_status.total_nodes = 1; |
| @@ -263,9 +258,6 @@ static void BeginHostingNetwork(Interface* self) { | |||
| 263 | if (network_info.channel != 0) | 258 | if (network_info.channel != 0) |
| 264 | network_channel = network_info.channel; | 259 | network_channel = network_info.channel; |
| 265 | 260 | ||
| 266 | // Clear the pre-existing application data. | ||
| 267 | application_data.clear(); | ||
| 268 | |||
| 269 | connection_status_event->Signal(); | 261 | connection_status_event->Signal(); |
| 270 | 262 | ||
| 271 | // TODO(Subv): Start broadcasting the network, send a beacon frame every 102.4ms. | 263 | // TODO(Subv): Start broadcasting the network, send a beacon frame every 102.4ms. |
| @@ -333,8 +325,8 @@ static void SetApplicationData(Interface* self) { | |||
| 333 | return; | 325 | return; |
| 334 | } | 326 | } |
| 335 | 327 | ||
| 336 | application_data.resize(size); | 328 | network_info.application_data_size = size; |
| 337 | Memory::ReadBlock(address, application_data.data(), size); | 329 | Memory::ReadBlock(address, network_info.application_data.data(), size); |
| 338 | 330 | ||
| 339 | rb.Push(RESULT_SUCCESS); | 331 | rb.Push(RESULT_SUCCESS); |
| 340 | } | 332 | } |
| @@ -379,7 +371,7 @@ NWM_UDS::NWM_UDS() { | |||
| 379 | } | 371 | } |
| 380 | 372 | ||
| 381 | NWM_UDS::~NWM_UDS() { | 373 | NWM_UDS::~NWM_UDS() { |
| 382 | application_data.clear(); | 374 | network_info = {}; |
| 383 | bind_node_events.clear(); | 375 | bind_node_events.clear(); |
| 384 | connection_status_event = nullptr; | 376 | connection_status_event = nullptr; |
| 385 | recv_buffer_memory = nullptr; | 377 | recv_buffer_memory = nullptr; |