ldn: Added ldnSetProtocol.

This commit is contained in:
yellows8 2025-06-18 18:17:05 -04:00
parent 0a4ac1b87c
commit dfee0c8ba2
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 20 additions and 0 deletions

View File

@ -67,6 +67,12 @@ typedef enum {
LdnWirelessControllerRestriction_Unknown1 = 1, ///< Unknown
} LdnWirelessControllerRestriction;
/// Protocol
typedef enum {
LdnProtocol_NX = 1, ///< NX (default)
LdnProtocol_Unknown3 = 3, ///< (NXAndOunce?)
} LdnProtocol;
/// Ipv4Address. This is essentially the same as struct in_addr - hence this can be used with standard sockets (byteswap required).
typedef struct {
u32 addr; ///< Address
@ -331,6 +337,13 @@ Result ldnScanPrivate(s32 channel, const LdnScanFilter *filter, LdnNetworkInfo *
*/
Result ldnSetWirelessControllerRestriction(LdnWirelessControllerRestriction restriction);
/**
* @brief SetProtocol
* @note This is only usable with [20.0.0+] (with [18.0.0-19-0.1] this is available but not usable).
* @param[in] protocol \ref LdnProtocol
*/
Result ldnSetProtocol(LdnProtocol protocol);
/**
* @brief OpenAccessPoint
* @note \ref LdnState must be ::LdnState_Initialized, this eventually sets the State to ::LdnState_AccessPointOpened.

View File

@ -289,6 +289,13 @@ Result ldnSetWirelessControllerRestriction(LdnWirelessControllerRestriction rest
return _ldnCmdInU32NoOut(&g_ldnSrv, restriction, 104);
}
Result ldnSetProtocol(LdnProtocol protocol) {
if (hosversionBefore(18,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _ldnCmdInU32NoOut(&g_ldnSrv, protocol, 106);
}
Result ldnOpenAccessPoint(void) {
return _ldnCmdNoIO(&g_ldnSrv, 200);
}