Add support for Mocha_StartTCPSyslogLogging and friends

This commit is contained in:
Maschell
2026-01-25 10:38:36 +01:00
parent 0b5296b43c
commit ff799cab48
3 changed files with 85 additions and 12 deletions

View File

@@ -12,6 +12,9 @@ extern "C" {
#define IPC_CUSTOM_START_USB_LOGGING 0xFA
#define IPC_CUSTOM_COPY_ENVIRONMENT_PATH 0xF9
#define IPC_CUSTOM_GET_MOCHA_API_VERSION 0xF8
#define IPC_CUSTOM_START_TCP_LOGGING 0xF7
#define IPC_CUSTOM_STOP_TCP_LOGGING 0xF6
#define IPC_CUSTOM_START_IOPSHELL_SERVER 0xF5
typedef enum LoadRPXTargetEnum {
LOAD_RPX_TARGET_SD_CARD = 0,

View File

@@ -153,10 +153,39 @@ MochaUtilsStatus Mocha_GetEnvironmentPath(char *environmentPathBuffer, uint32_t
* @return MOCHA_RESULT_SUCCESS: Logging via USB starts or has already been started<br>
* MOCHA_RESULT_LIB_UNINITIALIZED: Library was not initialized. Call Mocha_InitLibrary() before using this function.<br>
* MOCHA_RESULT_UNSUPPORTED_COMMAND: Command not supported by the currently loaded mocha version.<br>
* MOCHA_RESULT_UNKNOWN_ERROR: Failed to retrieve the environment path.
* MOCHA_RESULT_UNKNOWN_ERROR: Failed to start the usb logging.
*/
MochaUtilsStatus Mocha_StartUSBLogging(bool notSkipExistingLogs);
/**
* Enables logging via TCP via OSReport and friends. See the tcp script for receiving logs<br>
* @param limitToIp If set to true, only connection to the ip specified in "ipFilter" will be accepted
* @param ipFilter Defined the ip address the console will connect for usb logs
* @return MOCHA_RESULT_SUCCESS: Logging via TCP starts or has already been started<br>
* MOCHA_RESULT_LIB_UNINITIALIZED: Library was not initialized. Call Mocha_InitLibrary() before using this function.<br>
* MOCHA_RESULT_UNSUPPORTED_COMMAND: Command not supported by the currently loaded mocha version.<br>
* MOCHA_RESULT_UNKNOWN_ERROR: Failed to start
*/
MochaUtilsStatus Mocha_StartTCPSyslogLogging(bool limitToIp, uint32_t ipFilter);
/**
* Disabled logging via TCP. <br>
* @return MOCHA_RESULT_SUCCESS: Logging via stops<br>
* MOCHA_RESULT_LIB_UNINITIALIZED: Library was not initialized. Call Mocha_InitLibrary() before using this function.<br>
* MOCHA_RESULT_UNSUPPORTED_COMMAND: Command not supported by the currently loaded mocha version.<br>
* MOCHA_RESULT_UNKNOWN_ERROR: Failed to stop
*/
MochaUtilsStatus Mocha_StopTCPSyslogLogging();
/**
* Starts the iopshell server. <br>
* @return MOCHA_RESULT_SUCCESS: IOPShell server starts or has already been started<br>
* MOCHA_RESULT_LIB_UNINITIALIZED: Library was not initialized. Call Mocha_InitLibrary() before using this function.<br>
* MOCHA_RESULT_UNSUPPORTED_COMMAND: Command not supported by the currently loaded mocha version.<br>
* MOCHA_RESULT_UNKNOWN_ERROR: Failed to start
*/
MochaUtilsStatus Mocha_StartIOPShellServer();
/**
* Gives a FSClient full permissions. <br>
* Requires Mocha API Version: 1