mirror of
https://github.com/aaru-dps/aaruremote.git
synced 2025-12-16 19:24:37 +00:00
49 lines
1.5 KiB
C
49 lines
1.5 KiB
C
|
|
/*
|
||
|
|
* This file is part of the DiscImageChef Remote Server.
|
||
|
|
* Copyright (c) 2019 Natalia Portillo.
|
||
|
|
*
|
||
|
|
* This program is free software: you can redistribute it and/or modify
|
||
|
|
* it under the terms of the GNU General Public License as published by
|
||
|
|
* the Free Software Foundation, version 3.
|
||
|
|
*
|
||
|
|
* This program is distributed in the hope that it will be useful, but
|
||
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
|
* General Public License for more details.
|
||
|
|
*
|
||
|
|
* You should have received a copy of the GNU General Public License
|
||
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
|
*/
|
||
|
|
|
||
|
|
#include "../dicmote.h"
|
||
|
|
|
||
|
|
#include <gccore.h>
|
||
|
|
#include <stdbool.h>
|
||
|
|
#include <stddef.h>
|
||
|
|
#include <stdio.h>
|
||
|
|
#include <stdlib.h>
|
||
|
|
#include <string.h>
|
||
|
|
|
||
|
|
DeviceInfoList* WiiListDevices()
|
||
|
|
{
|
||
|
|
DeviceInfoList *list_start = NULL, *list_current = NULL, *list_next = NULL;
|
||
|
|
|
||
|
|
u32 deviceId = 0;
|
||
|
|
|
||
|
|
list_next = malloc(sizeof(DeviceInfoList));
|
||
|
|
memset(list_next, 0, sizeof(DeviceInfoList));
|
||
|
|
|
||
|
|
// All Wiis do have flash
|
||
|
|
strncpy(list_next->this.path, "/dev/flash", 1024);
|
||
|
|
strncpy(list_next->this.vendor, "Nintendo", 256);
|
||
|
|
strncpy(list_next->this.model, "Wii NAND", 256);
|
||
|
|
strncpy(list_next->this.bus, "NAND", 256);
|
||
|
|
list_next->this.supported = false; // TODO: Implement NAND reading
|
||
|
|
|
||
|
|
if(ES_GetDeviceID(&deviceId) < 0) snprintf(list_next->this.serial, 256, "%d", deviceId);
|
||
|
|
|
||
|
|
list_start = list_next;
|
||
|
|
list_current = list_start;
|
||
|
|
|
||
|
|
return list_start;
|
||
|
|
}
|