]> Chaos Git - corbenik/ctrulib.git/commitdiff
Properly load the UDS network wifi channel, apparently it was hard-coded to channel...
authoryellows8 <yellows8@users.noreply.github.com>
Thu, 7 Apr 2016 14:04:48 +0000 (10:04 -0400)
committeryellows8 <yellows8@users.noreply.github.com>
Thu, 7 Apr 2016 14:04:48 +0000 (10:04 -0400)
libctru/include/3ds/services/uds.h
libctru/source/services/uds.c

index e894310268c37d3a4d2cff951904bfb821203a5d..34fb5664d22836ea4f3dcba72f23ce96b87ee848 100644 (file)
@@ -39,8 +39,8 @@ typedef struct {
 /// Network struct stored as big-endian.
 typedef struct {
        u8 host_macaddress[6];
-       u8 hostmacaddr_flag;//"This flag being set to non-zero presumably indicates that the MAC address is set."
-       u8 unk_x7;
+       u8 channel;//Wifi channel for this network.
+       u8 pad_x7;
 
        u8 initialized_flag;//Must be non-zero otherwise NWM-module will use zeros internally instead of the actual field data, for most/all(?) of the fields in this struct.
 
@@ -95,7 +95,10 @@ typedef struct {
 /// General NWM output structure from AP scanning, for each entry.
 typedef struct {
        u32 size;//"Size of this entire entry. The next entry starts at curentry_startoffset+curentry_size."
-       u32 unk_x4;
+       u8 unk_x4;
+       u8 channel;//Wifi channel for the AP.
+       u8 unk_x6;
+       u8 unk_x7;
        u8 mac_address[6];//"AP MAC address."
        u8 unk_xe[6];
        u32 unk_x14;
index 1434f765fae99e9476a38138e2a773d6c0a52690..ded5e1df467cfa17a72cccbe3ce13b0841de1485 100644 (file)
@@ -694,7 +694,7 @@ static Result usd_parsebeacon(u8 *buf, u32 size, udsNetworkScanInfo *networkscan
                if(appdata_size)memcpy(networkscan->network.appdata, &tagptr[0x34], appdata_size);
 
                networkscan->network.initialized_flag = 1;
-               networkscan->network.hostmacaddr_flag = 1;
+               networkscan->network.channel = networkscan->datareply_entry.channel;
                memcpy(networkscan->network.host_macaddress, networkscan->datareply_entry.mac_address, sizeof(networkscan->network.host_macaddress));
        }