Skip to content

Commit dfee0c8

Browse files
committed
ldn: Added ldnSetProtocol.
1 parent 0a4ac1b commit dfee0c8

File tree

2 files changed

+20
-0
lines changed
  • nx

2 files changed

+20
-0
lines changed

nx/include/switch/services/ldn.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ typedef enum {
6767
LdnWirelessControllerRestriction_Unknown1 = 1, ///< Unknown
6868
} LdnWirelessControllerRestriction;
6969

70+
/// Protocol
71+
typedef enum {
72+
LdnProtocol_NX = 1, ///< NX (default)
73+
LdnProtocol_Unknown3 = 3, ///< (NXAndOunce?)
74+
} LdnProtocol;
75+
7076
/// Ipv4Address. This is essentially the same as struct in_addr - hence this can be used with standard sockets (byteswap required).
7177
typedef struct {
7278
u32 addr; ///< Address
@@ -331,6 +337,13 @@ Result ldnScanPrivate(s32 channel, const LdnScanFilter *filter, LdnNetworkInfo *
331337
*/
332338
Result ldnSetWirelessControllerRestriction(LdnWirelessControllerRestriction restriction);
333339

340+
/**
341+
* @brief SetProtocol
342+
* @note This is only usable with [20.0.0+] (with [18.0.0-19-0.1] this is available but not usable).
343+
* @param[in] protocol \ref LdnProtocol
344+
*/
345+
Result ldnSetProtocol(LdnProtocol protocol);
346+
334347
/**
335348
* @brief OpenAccessPoint
336349
* @note \ref LdnState must be ::LdnState_Initialized, this eventually sets the State to ::LdnState_AccessPointOpened.

nx/source/services/ldn.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,13 @@ Result ldnSetWirelessControllerRestriction(LdnWirelessControllerRestriction rest
289289
return _ldnCmdInU32NoOut(&g_ldnSrv, restriction, 104);
290290
}
291291

292+
Result ldnSetProtocol(LdnProtocol protocol) {
293+
if (hosversionBefore(18,0,0))
294+
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
295+
296+
return _ldnCmdInU32NoOut(&g_ldnSrv, protocol, 106);
297+
}
298+
292299
Result ldnOpenAccessPoint(void) {
293300
return _ldnCmdNoIO(&g_ldnSrv, 200);
294301
}

0 commit comments

Comments
 (0)