Skip to content

Latest commit

 

History

History
138 lines (108 loc) · 4.07 KB

File metadata and controls

138 lines (108 loc) · 4.07 KB

UnityOrbisBridge (.DLL) API for Unity

A library to import all the the functions from the plugin / .prx for quick and easy usage in your Unity projects; best if used with UOBWrapper.

Features / Functions

Web Interaction

Click to expand
  • IntPtr GetDownloadInfo(string info)
    bool HasDownloadCompleted()
    bool HasDownloadErrorOccured()
    void ResetDownloadVars()
    void CancelDownload()
    IntPtr DownloadWebFile(string url, string savePath, bool isBackgroundDL, string displayName)
    IntPtr DownloadAsBytes(string url, out int size)

Logging and Notifications

Click to expand
  • void PrintToConsole(const char *message, int type)
    void PrintAndLog(const char *message, int type, const char *file)
    void TextNotify(int type, string message)
    void ImageNotify(string imageURL, string message)

System Information

Click to expand
  •    bool IsPlayStation5()
       IntPtr GetFWVersion()
       IntPtr GetConsoleType()
       int GetSystemLanguageID()
       IntPtr GetSystemLanguage()
       int GetCPUTemperature()
       int GetSOCTemperature()

System Control

Click to expand
  • void SetTemperatureLimit(byte limit)
    IntPtr GetKeyboardInput(string title = "Please Enter Text:", string initialText = "Default Text")
    void AlarmBuzzer(int type)
    void RunCMDAsRoot(IntPtr function, IntPtr arg, int cwdMode)

File System Operations

Click to expand
  • IntPtr GetDiskInfo(string type)
    void WriteFile(string content, string file)
    void AppendFile(string content, string file)
    void MountRootDirectories()
    void InstallLocalPackage(string uri, string name, bool deleteAfter)
    void DownloadAndInstallPKG(string url, string name, string icon)
    bool CheckIfAppExists(string titleId)

Application Operations

Click to expand
  • void InitializeNativeDialogs()
    bool IsFreeOfSandbox()
    void EnterSandbox()
    void BreakFromSandbox()
    void MountInSandbox(string systemPath, string mountName)
    void UnmountFromSandbox(string mountName)
    void ExitApplication()
    void UpdateViaHomebrewStore(string query)

Helper Methods

Click to expand
  • string GetDiskInfo(DiskInfo info)
    string GetDiskInfoAsFormattedText(DiskInfo info, Dictionary<DiskInfo, string> diskInfo)
    float? GetTemperature(Temperature temperature = Temperature.CPU, bool fahrenheit = false)
    void DownloadWebFile(string url, string path, string file, string extension, bool bgDL = false, string name = "NULL")
    void DownloadPkgFile(string url, string path, string file, bool bgDL = false, string name = "NULL")

Notes

  • Memory Management
    Automatic marshaling is provided for most types. However, native pointers (IntPtr) require manual cleanup.

  • Error Handling
    Basic error handling is implemented. Add exceptions and fallbacks as needed for robustness.

  • Private Functions
    PrivateImports is intended for internal use only. Avoid calling directly unless necessary for custom scenarios.

  • Helper Functions
    Utilize helper functions to streamline your code and handle common use cases more efficiently.

Example Usage of Intptr

Several functions return IntPtr, which you can use to interact with unmanaged data.

// Get the firmware version as IntPtr
IntPtr fwVersionPtr = uob.GetFWVersion();

// Marshal the IntPtr to a C# string
string fwVersion = Marshal.PtrToStringAnsi(fwVersionPtr);

// Display the firmware version in the Unity console
Debug.Log("Firmware Version: " + fwVersion);

License

This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.