Moved code to dolphin for network
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "error/error.h"
|
||||
#include "network/networkinfo.h"
|
||||
#include <network.h>
|
||||
|
||||
#define NETWORK_DOLPHIN_IP_MAX 16
|
||||
|
||||
typedef struct {
|
||||
char_t ip[NETWORK_DOLPHIN_IP_MAX];
|
||||
char_t netmask[NETWORK_DOLPHIN_IP_MAX];
|
||||
char_t gateway[NETWORK_DOLPHIN_IP_MAX];
|
||||
|
||||
void *onConnectedUser;
|
||||
void (*onConnected)(void *user);
|
||||
void (*onFailed)(errorret_t error, void *user);
|
||||
} networkdolphin_t;
|
||||
|
||||
/**
|
||||
* Initializes the Wii network stack via IOS. Does not connect; use
|
||||
* networkDolphinRequestConnection for that.
|
||||
*
|
||||
* @return Error state (if any).
|
||||
*/
|
||||
errorret_t networkDolphinInit();
|
||||
|
||||
/**
|
||||
* Called each frame. No-op on Wii since connection is synchronous.
|
||||
*
|
||||
* @return Error state (if any).
|
||||
*/
|
||||
errorret_t networkDolphinUpdate();
|
||||
|
||||
/**
|
||||
* Disposes the Wii network stack.
|
||||
*
|
||||
* @return Error state (if any).
|
||||
*/
|
||||
errorret_t networkDolphinDispose();
|
||||
|
||||
/**
|
||||
* Returns true if the Wii is connected to a network.
|
||||
*
|
||||
* @return True if connected.
|
||||
*/
|
||||
bool_t networkDolphinIsConnected();
|
||||
|
||||
/**
|
||||
* Requests the Wii to connect to the network using the Wi-Fi settings saved
|
||||
* in the Wii System Menu. Blocks until connected or failed.
|
||||
*
|
||||
* @param onConnected Callback on successful connection.
|
||||
* @param onFailed Callback if connection fails.
|
||||
* @param onDisconnect Callback when connection is later lost.
|
||||
* @param user User data passed to all callbacks.
|
||||
*/
|
||||
void networkDolphinRequestConnection(
|
||||
void (*onConnected)(void *user),
|
||||
void (*onFailed)(errorret_t error, void *user),
|
||||
void (*onDisconnect)(errorret_t error, void *user),
|
||||
void *user
|
||||
);
|
||||
|
||||
/**
|
||||
* Requests the Wii to disconnect from the network.
|
||||
*
|
||||
* @param onComplete Callback when disconnection is complete.
|
||||
* @param user User data passed to the callback.
|
||||
*/
|
||||
void networkDolphinRequestDisconnection(
|
||||
void (*onComplete)(void *user),
|
||||
void *user
|
||||
);
|
||||
|
||||
/**
|
||||
* Returns the current network IP information.
|
||||
*
|
||||
* @return Network info for the active connection.
|
||||
*/
|
||||
networkinfo_t networkDolphinGetInfo();
|
||||
Reference in New Issue
Block a user