mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
btdrv: split RespondToPinRequest service wrapper into legacy and current versions
This commit is contained in:
parent
3c7d4921dd
commit
e20d779bd0
@ -501,14 +501,21 @@ Result btdrvRemoveBond(BtdrvAddress addr);
|
|||||||
Result btdrvCancelBond(BtdrvAddress addr);
|
Result btdrvCancelBond(BtdrvAddress addr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief RespondToPinRequest
|
* @brief RespondToPinRequest [1.0.0-11.0.1]
|
||||||
* @note The official sysmodule only uses the input \ref BtdrvAddress.
|
* @note The official sysmodule only uses the input \ref BtdrvAddress.
|
||||||
* @param[in] addr \ref BtdrvAddress
|
* @param[in] addr \ref BtdrvAddress
|
||||||
* @param[in] flag Flag
|
* @param[in] flag Flag
|
||||||
* @param[in] pin_code \ref BtdrvBluetoothPinCode
|
* @param[in] pin_code \ref BtdrvBluetoothPinCode
|
||||||
* @param[in] length Length of pin_code
|
* @param[in] length Length of pin_code
|
||||||
*/
|
*/
|
||||||
Result btdrvRespondToPinRequest(BtdrvAddress addr, bool flag, const BtdrvBluetoothPinCode *pin_code, u8 length);
|
Result btdrvLegacyRespondToPinRequest(BtdrvAddress addr, bool flag, const BtdrvBluetoothPinCode *pin_code, u8 length);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief RespondToPinRequest [12.0.0+]
|
||||||
|
* @param[in] addr \ref BtdrvAddress
|
||||||
|
* @param[in] pin_code \ref BtdrvPinCode
|
||||||
|
*/
|
||||||
|
Result btdrvRespondToPinRequest(BtdrvAddress addr, const BtdrvPinCode *pin_code);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief RespondToSspRequest
|
* @brief RespondToSspRequest
|
||||||
|
@ -229,8 +229,10 @@ Result btdrvCancelBond(BtdrvAddress addr) {
|
|||||||
return _btdrvCmdInAddrNoOut(addr, 12);
|
return _btdrvCmdInAddrNoOut(addr, 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result btdrvRespondToPinRequest(BtdrvAddress addr, bool flag, const BtdrvBluetoothPinCode *pin_code, u8 length) {
|
Result btdrvLegacyRespondToPinRequest(BtdrvAddress addr, bool flag, const BtdrvBluetoothPinCode *pin_code, u8 length) {
|
||||||
if (hosversionBefore(12,0,0)) {
|
if (hosversionAtLeast(12,0,0))
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
|
|
||||||
const struct {
|
const struct {
|
||||||
BtdrvAddress addr;
|
BtdrvAddress addr;
|
||||||
u8 flag;
|
u8 flag;
|
||||||
@ -240,16 +242,18 @@ Result btdrvRespondToPinRequest(BtdrvAddress addr, bool flag, const BtdrvBluetoo
|
|||||||
|
|
||||||
return serviceDispatchIn(&g_btdrvSrv, 13, in);
|
return serviceDispatchIn(&g_btdrvSrv, 13, in);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
|
Result btdrvRespondToPinRequest(BtdrvAddress addr, const BtdrvPinCode *pin_code) {
|
||||||
|
if (hosversionBefore(12,0,0))
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
|
|
||||||
const struct {
|
const struct {
|
||||||
BtdrvAddress addr;
|
BtdrvAddress addr;
|
||||||
BtdrvBluetoothPinCode pin_code;
|
BtdrvPinCode pin_code;
|
||||||
uint8_t length;
|
} in = { addr, *pin_code };
|
||||||
} in = { addr, *pin_code, length };
|
|
||||||
|
|
||||||
return serviceDispatchIn(&g_btdrvSrv, 13, in);
|
return serviceDispatchIn(&g_btdrvSrv, 13, in);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Result btdrvRespondToSspRequest(BtdrvAddress addr, u8 variant, bool flag, u32 unk) {
|
Result btdrvRespondToSspRequest(BtdrvAddress addr, u8 variant, bool flag, u32 unk) {
|
||||||
const struct {
|
const struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user