summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nwm/nwm_uds.h
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-03-13 22:53:20 +0100
committerSubv <subv2112@gmail.com>2017-03-26 15:17:51 +0200
commit9771615f1638c2a548067717c12426539ad60541 (patch)
treef917581b6d94df36dd79655d338be40205447c18 /src/core/hle/service/nwm/nwm_uds.h
parentMerge pull request #2614 from Schplee/patch-1 (diff)
downloadyuzu-9771615f1638c2a548067717c12426539ad60541.tar
yuzu-9771615f1638c2a548067717c12426539ad60541.tar.gz
yuzu-9771615f1638c2a548067717c12426539ad60541.tar.bz2
yuzu-9771615f1638c2a548067717c12426539ad60541.tar.lz
yuzu-9771615f1638c2a548067717c12426539ad60541.tar.xz
yuzu-9771615f1638c2a548067717c12426539ad60541.tar.zst
yuzu-9771615f1638c2a548067717c12426539ad60541.zip
Diffstat (limited to 'src/core/hle/service/nwm/nwm_uds.h')
-rw-r--r--src/core/hle/service/nwm/nwm_uds.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/core/hle/service/nwm/nwm_uds.h b/src/core/hle/service/nwm/nwm_uds.h
index 55db748f6..3dfc32de8 100644
--- a/src/core/hle/service/nwm/nwm_uds.h
+++ b/src/core/hle/service/nwm/nwm_uds.h
@@ -4,6 +4,10 @@
#pragma once
+#include <array>
+#include <cstddef>
+#include "common/common_types.h"
+#include "common/swap.h"
#include "core/hle/service/service.h"
// Local-WLAN service
@@ -11,6 +15,63 @@
namespace Service {
namespace NWM {
+const size_t ApplicationDataSize = 0xC8;
+const u8 DefaultNetworkChannel = 11;
+
+struct NodeInfo {
+ u64_le friend_code_seed;
+ std::array<u16_le, 10> username;
+ INSERT_PADDING_BYTES(4);
+ u16_le network_node_id;
+ INSERT_PADDING_BYTES(6);
+};
+
+static_assert(sizeof(NodeInfo) == 40, "NodeInfo has incorrect size.");
+
+enum class NetworkStatus {
+ NotConnected = 3,
+ ConnectedAsHost = 6,
+ ConnectedAsClient = 9,
+ ConnectedAsSpectator = 10,
+};
+
+struct ConnectionStatus {
+ u32_le status;
+ INSERT_PADDING_WORDS(1);
+ u16_le network_node_id;
+ INSERT_PADDING_BYTES(2);
+ INSERT_PADDING_BYTES(32);
+ u8 total_nodes;
+ u8 max_nodes;
+ u16_le node_bitmask;
+};
+
+static_assert(sizeof(ConnectionStatus) == 0x30, "ConnectionStatus has incorrect size.");
+
+struct NetworkInfo {
+ std::array<u8, 6> host_mac_address;
+ u8 channel;
+ INSERT_PADDING_BYTES(1);
+ u8 initialized;
+ INSERT_PADDING_BYTES(3);
+ std::array<u8, 3> oui_value;
+ u8 oui_type;
+ // This field is received as BigEndian from the game.
+ u32_be wlan_comm_id;
+ u8 id;
+ INSERT_PADDING_BYTES(1);
+ u16_be attributes;
+ u32_be network_id;
+ u8 total_nodes;
+ u8 max_nodes;
+ INSERT_PADDING_BYTES(2);
+ INSERT_PADDING_BYTES(0x1F);
+ u8 application_data_size;
+ std::array<u8, ApplicationDataSize> application_data;
+};
+
+static_assert(sizeof(NetworkInfo) == 0x108, "NetworkInfo has incorrect size.");
+
class NWM_UDS final : public Interface {
public:
NWM_UDS();