From fa70037055a8466449e05acdac350a7de2cfe5c6 Mon Sep 17 00:00:00 2001 From: yellows8 Date: Tue, 5 Apr 2016 11:01:16 -0400 Subject: [PATCH] Added host_macaddress parameter to udsScanBeacons(). --- libctru/include/3ds/services/uds.h | 3 ++- libctru/source/services/uds.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libctru/include/3ds/services/uds.h b/libctru/include/3ds/services/uds.h index e01e4fd..ef14bc6 100644 --- a/libctru/include/3ds/services/uds.h +++ b/libctru/include/3ds/services/uds.h @@ -162,8 +162,9 @@ void udsGenerateDefaultNetworkStruct(udsNetworkStruct *network, u32 wlancommID, * @Param total_networks Total number of networks stored under the networks buffer. * @param wlancommID Unique local-WLAN communications ID for each application. * @param id8 Additional ID that can be used by the application for different types of networks. + * @param host_macaddress When set, this code will only return network info from the specified host MAC address. */ -Result udsScanBeacons(u8 *outbuf, u32 maxsize, udsNetworkScanInfo **networks, u32 *total_networks, u32 wlancommID, u8 id8); +Result udsScanBeacons(u8 *outbuf, u32 maxsize, udsNetworkScanInfo **networks, u32 *total_networks, u32 wlancommID, u8 id8, u8 *host_macaddress); /** * @brief Create a bind. diff --git a/libctru/source/services/uds.c b/libctru/source/services/uds.c index 032be6a..fef849b 100644 --- a/libctru/source/services/uds.c +++ b/libctru/source/services/uds.c @@ -332,7 +332,7 @@ Result udsDisconnectNetwork(void) return cmdbuf[1]; } -Result udsScanBeacons(u8 *outbuf, u32 maxsize, udsNetworkScanInfo **networks, u32 *total_networks, u32 wlancommID, u8 id8) +Result udsScanBeacons(u8 *outbuf, u32 maxsize, udsNetworkScanInfo **networks, u32 *total_networks, u32 wlancommID, u8 id8, u8 *host_macaddress) { Result ret=0; Handle event=0; @@ -353,6 +353,7 @@ Result udsScanBeacons(u8 *outbuf, u32 maxsize, udsNetworkScanInfo **networks, u3 scaninput.unk_x6 = 0x6e; memset(scaninput.mac_address, 0xff, sizeof(scaninput.mac_address)); + if(host_macaddress)memcpy(scaninput.mac_address, host_macaddress, sizeof(scaninput.mac_address)); if(maxsize < sizeof(nwmBeaconDataReplyHeader))return -2;