mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
btm/btdrv: Updated param names.
This commit is contained in:
parent
a35321b360
commit
e9ee0b2421
@ -56,10 +56,10 @@ bool btdevGattAttributeUuidIsSame(const BtdrvGattAttributeUuid *a, const BtdrvGa
|
||||
Result btdevAcquireBleScanEvent(Event* out_event);
|
||||
|
||||
/// Wrapper for \ref btmuGetBleScanFilterParameter.
|
||||
Result btdevGetBleScanParameter(u16 unk, BtdrvBleAdvertisePacketParameter *out);
|
||||
Result btdevGetBleScanParameter(u16 parameter_id, BtdrvBleAdvertisePacketParameter *out);
|
||||
|
||||
/// Wrapper for \ref btmuGetBleScanFilterParameter2.
|
||||
Result btdevGetBleScanParameter2(u16 unk, BtdrvGattAttributeUuid *out);
|
||||
Result btdevGetBleScanParameter2(u16 parameter_id, BtdrvGattAttributeUuid *out);
|
||||
|
||||
/// Wrapper for \ref btdevStartBleScanGeneral.
|
||||
Result btdevStartBleScanGeneral(BtdrvBleAdvertisePacketParameter param);
|
||||
@ -94,7 +94,7 @@ Result btdevAcquireBleConnectionStateChangedEvent(Event* out_event);
|
||||
Result btdevConnectToGattServer(BtdrvAddress addr);
|
||||
|
||||
/// Wrapper for \ref btmuBleDisconnect.
|
||||
Result btdevDisconnectFromGattServer(u32 id);
|
||||
Result btdevDisconnectFromGattServer(u32 connection_handle);
|
||||
|
||||
/// Wrapper for \ref btmuBleGetConnectionState.
|
||||
Result btdevGetBleConnectionInfoList(BtdrvBleConnectionInfo *info, u8 count, u8 *total_out);
|
||||
|
@ -264,18 +264,18 @@ Result btmAcquireBleScanEvent(Event* out_event);
|
||||
/**
|
||||
* @brief GetBleScanParameterGeneral
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[in] unk Must be value 0x1 or 0xFFFF.
|
||||
* @param[in] parameter_id Must be value 0x1 or 0xFFFF.
|
||||
* @param[out] out \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmGetBleScanParameterGeneral(u16 unk, BtdrvBleAdvertisePacketParameter *out);
|
||||
Result btmGetBleScanParameterGeneral(u16 parameter_id, BtdrvBleAdvertisePacketParameter *out);
|
||||
|
||||
/**
|
||||
* @brief GetBleScanParameterSmartDevice
|
||||
* @note Only available on [5.1.0+].
|
||||
* @param[in] unk Must be value 0x2.
|
||||
* @param[in] parameter_id Must be value 0x2.
|
||||
* @param[out] out \ref BtdrvGattAttributeUuid. The first 4-bytes is always 0.
|
||||
*/
|
||||
Result btmGetBleScanParameterSmartDevice(u16 unk, BtdrvGattAttributeUuid *out);
|
||||
Result btmGetBleScanParameterSmartDevice(u16 parameter_id, BtdrvGattAttributeUuid *out);
|
||||
|
||||
/**
|
||||
* @brief StartBleScanForGeneral
|
||||
@ -454,44 +454,44 @@ Result btmGetGattService(u32 connection_handle, const BtdrvGattAttributeUuid *uu
|
||||
* @brief Same as \ref btmGetGattServices except this only returns \ref BtmGattService entries where various checks pass with u16 fields.
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[in] handle Handle
|
||||
* @param[in] service_handle ServiceHandle
|
||||
* @param[out] services \ref BtmGattService
|
||||
* @param[in] count Size of the services array in entries. The max is 100.
|
||||
* @param[out] out Output value.
|
||||
*/
|
||||
Result btmGetGattIncludedServices(u32 connection_handle, u16 handle, BtmGattService *services, u8 count, u8 *out);
|
||||
Result btmGetGattIncludedServices(u32 connection_handle, u16 service_handle, BtmGattService *services, u8 count, u8 *out);
|
||||
|
||||
/**
|
||||
* @brief This is similar to \ref btmGetGattIncludedServices except this only returns 1 \ref BtmGattService.
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[in] handle Handle
|
||||
* @param[in] attribute_handle AttributeHandle
|
||||
* @param[out] service \ref BtmGattService
|
||||
* @param[out] flag Whether a \ref BtmGattService was returned.
|
||||
*/
|
||||
Result btmGetBelongingService(u32 connection_handle, u16 handle, BtmGattService *service, bool *flag);
|
||||
Result btmGetBelongingService(u32 connection_handle, u16 attribute_handle, BtmGattService *service, bool *flag);
|
||||
|
||||
/**
|
||||
* @brief GetGattCharacteristics
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[in] handle This controls which \ref BtmGattCharacteristic entries to return.
|
||||
* @param[in] service_handle This controls which \ref BtmGattCharacteristic entries to return.
|
||||
* @param[out] characteristics \ref BtmGattCharacteristic
|
||||
* @param[in] count Size of the characteristics array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmGetGattCharacteristics(u32 connection_handle, u16 handle, BtmGattCharacteristic *characteristics, u8 count, u8 *total_out);
|
||||
Result btmGetGattCharacteristics(u32 connection_handle, u16 service_handle, BtmGattCharacteristic *characteristics, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief GetGattDescriptors
|
||||
* @note Only available on [5.0.0+].
|
||||
* @param[in] connection_handle Same as \ref btmBleDisconnect.
|
||||
* @param[in] handle This controls which \ref BtmGattDescriptor entries to return.
|
||||
* @param[in] char_handle Characteristic handle. This controls which \ref BtmGattDescriptor entries to return.
|
||||
* @param[out] descriptors \ref BtmGattDescriptor
|
||||
* @param[in] count Size of the descriptors array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmGetGattDescriptors(u32 connection_handle, u16 handle, BtmGattDescriptor *descriptors, u8 count, u8 *total_out);
|
||||
Result btmGetGattDescriptors(u32 connection_handle, u16 char_handle, BtmGattDescriptor *descriptors, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief AcquireBleMtuConfigEvent
|
||||
|
@ -36,18 +36,18 @@ Result btmuAcquireBleScanEvent(Event* out_event);
|
||||
/**
|
||||
* @brief GetBleScanFilterParameter
|
||||
* @note This is the same as \ref btmGetBleScanParameterGeneral.
|
||||
* @param[in] unk Must be value 0x1 or 0xFFFF.
|
||||
* @param[in] parameter_id Must be value 0x1 or 0xFFFF.
|
||||
* @param[out] out \ref BtdrvBleAdvertisePacketParameter
|
||||
*/
|
||||
Result btmuGetBleScanFilterParameter(u16 unk, BtdrvBleAdvertisePacketParameter *out);
|
||||
Result btmuGetBleScanFilterParameter(u16 parameter_id, BtdrvBleAdvertisePacketParameter *out);
|
||||
|
||||
/**
|
||||
* @brief GetBleScanFilterParameter2
|
||||
* @note This is the same as \ref btmGetBleScanParameterSmartDevice.
|
||||
* @param[in] unk Must be value 0x2.
|
||||
* @param[in] parameter_id Must be value 0x2.
|
||||
* @param[out] out \ref BtdrvGattAttributeUuid. The first 4-bytes is always 0.
|
||||
*/
|
||||
Result btmuGetBleScanFilterParameter2(u16 unk, BtdrvGattAttributeUuid *out);
|
||||
Result btmuGetBleScanFilterParameter2(u16 parameter_id, BtdrvGattAttributeUuid *out);
|
||||
|
||||
/**
|
||||
* @brief StartBleScanForGeneral
|
||||
@ -211,44 +211,44 @@ Result btmuGetGattService(u32 connection_handle, const BtdrvGattAttributeUuid *u
|
||||
* @brief Same as \ref btmuGetGattServices except this only returns \ref BtmGattService entries where various checks pass with u16 fields.
|
||||
* @note This is similar to \ref btmGetGattIncludedServices.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[in] handle Handle
|
||||
* @param[in] service_handle ServiceHandle
|
||||
* @param[out] services \ref BtmGattService
|
||||
* @param[in] count Size of the services array in entries. The max is 100.
|
||||
* @param[out] out Output value.
|
||||
*/
|
||||
Result btmuGetGattIncludedServices(u32 connection_handle, u16 handle, BtmGattService *services, u8 count, u8 *out);
|
||||
Result btmuGetGattIncludedServices(u32 connection_handle, u16 service_handle, BtmGattService *services, u8 count, u8 *out);
|
||||
|
||||
/**
|
||||
* @brief This is similar to \ref btmuGetGattIncludedServices except this only returns 1 \ref BtmGattService.
|
||||
* @note This is similar to \ref btmGetBelongingService.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[in] handle Handle
|
||||
* @param[in] attribute_handle AttributeHandle
|
||||
* @param[out] service \ref BtmGattService
|
||||
* @param[out] flag Whether a \ref BtmGattService was returned.
|
||||
*/
|
||||
Result btmuGetBelongingGattService(u32 connection_handle, u16 handle, BtmGattService *service, bool *flag);
|
||||
Result btmuGetBelongingGattService(u32 connection_handle, u16 attribute_handle, BtmGattService *service, bool *flag);
|
||||
|
||||
/**
|
||||
* @brief GetGattCharacteristics
|
||||
* @note This is similar to \ref btmGetGattCharacteristics.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[in] handle This controls which \ref BtmGattCharacteristic entries to return.
|
||||
* @param[in] service_handle This controls which \ref BtmGattCharacteristic entries to return.
|
||||
* @param[out] characteristics \ref BtmGattCharacteristic
|
||||
* @param[in] count Size of the characteristics array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmuGetGattCharacteristics(u32 connection_handle, u16 handle, BtmGattCharacteristic *characteristics, u8 count, u8 *total_out);
|
||||
Result btmuGetGattCharacteristics(u32 connection_handle, u16 service_handle, BtmGattCharacteristic *characteristics, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief GetGattDescriptors
|
||||
* @note This is similar to \ref btmGetGattDescriptors.
|
||||
* @param[in] connection_handle Same as \ref btmuBleDisconnect.
|
||||
* @param[in] handle This controls which \ref BtmGattDescriptor entries to return.
|
||||
* @param[in] char_handle Characteristic handle. This controls which \ref BtmGattDescriptor entries to return.
|
||||
* @param[out] descriptors \ref BtmGattDescriptor
|
||||
* @param[in] count Size of the descriptors array in entries. The max is 100.
|
||||
* @param[out] total_out Total output entries.
|
||||
*/
|
||||
Result btmuGetGattDescriptors(u32 connection_handle, u16 handle, BtmGattDescriptor *descriptors, u8 count, u8 *total_out);
|
||||
Result btmuGetGattDescriptors(u32 connection_handle, u16 char_handle, BtmGattDescriptor *descriptors, u8 count, u8 *total_out);
|
||||
|
||||
/**
|
||||
* @brief AcquireBleMtuConfigEvent
|
||||
|
@ -31,12 +31,12 @@ Result btdevAcquireBleScanEvent(Event* out_event) {
|
||||
return btmuAcquireBleScanEvent(out_event);
|
||||
}
|
||||
|
||||
Result btdevGetBleScanParameter(u16 unk, BtdrvBleAdvertisePacketParameter *out) {
|
||||
return btmuGetBleScanFilterParameter(unk, out);
|
||||
Result btdevGetBleScanParameter(u16 parameter_id, BtdrvBleAdvertisePacketParameter *out) {
|
||||
return btmuGetBleScanFilterParameter(parameter_id, out);
|
||||
}
|
||||
|
||||
Result btdevGetBleScanParameter2(u16 unk, BtdrvGattAttributeUuid *out) {
|
||||
return btmuGetBleScanFilterParameter2(unk, out);
|
||||
Result btdevGetBleScanParameter2(u16 parameter_id, BtdrvGattAttributeUuid *out) {
|
||||
return btmuGetBleScanFilterParameter2(parameter_id, out);
|
||||
}
|
||||
|
||||
Result btdevStartBleScanGeneral(BtdrvBleAdvertisePacketParameter param) {
|
||||
@ -107,8 +107,8 @@ Result btdevConnectToGattServer(BtdrvAddress addr) {
|
||||
return btmuBleConnect(addr);
|
||||
}
|
||||
|
||||
Result btdevDisconnectFromGattServer(u32 id) {
|
||||
return btmuBleDisconnect(id);
|
||||
Result btdevDisconnectFromGattServer(u32 connection_handle) {
|
||||
return btmuBleDisconnect(connection_handle);
|
||||
}
|
||||
|
||||
Result btdevGetBleConnectionInfoList(BtdrvBleConnectionInfo *info, u8 count, u8 *total_out) {
|
||||
|
@ -270,18 +270,18 @@ Result btmAcquireBleScanEvent(Event* out_event) {
|
||||
return _btmCmdGetEventOutFlag(out_event, true, 23);
|
||||
}
|
||||
|
||||
Result btmGetBleScanParameterGeneral(u16 unk, BtdrvBleAdvertisePacketParameter *out) {
|
||||
Result btmGetBleScanParameterGeneral(u16 parameter_id, BtdrvBleAdvertisePacketParameter *out) {
|
||||
if (hosversionBefore(5,1,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
return serviceDispatchInOut(&g_btmSrv, 24, unk, *out);
|
||||
return serviceDispatchInOut(&g_btmSrv, 24, parameter_id, *out);
|
||||
}
|
||||
|
||||
Result btmGetBleScanParameterSmartDevice(u16 unk, BtdrvGattAttributeUuid *out) {
|
||||
Result btmGetBleScanParameterSmartDevice(u16 parameter_id, BtdrvGattAttributeUuid *out) {
|
||||
if (hosversionBefore(5,1,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
return serviceDispatchInOut(&g_btmSrv, 25, unk, *out);
|
||||
return serviceDispatchInOut(&g_btmSrv, 25, parameter_id, *out);
|
||||
}
|
||||
|
||||
Result btmStartBleScanForGeneral(BtdrvBleAdvertisePacketParameter param) {
|
||||
@ -473,24 +473,24 @@ Result btmGetGattService(u32 connection_handle, const BtdrvGattAttributeUuid *uu
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result btmGetGattIncludedServices(u32 connection_handle, u16 handle, BtmGattService *services, u8 count, u8 *out) {
|
||||
Result btmGetGattIncludedServices(u32 connection_handle, u16 service_handle, BtmGattService *services, u8 count, u8 *out) {
|
||||
if (hosversionBefore(5,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
u32 cmd_id = hosversionBefore(5,1,0) ? 31 : 48;
|
||||
|
||||
return _btmGetGattServiceData(connection_handle, handle, services, sizeof(BtmGattService), count, out, cmd_id);
|
||||
return _btmGetGattServiceData(connection_handle, service_handle, services, sizeof(BtmGattService), count, out, cmd_id);
|
||||
}
|
||||
|
||||
Result btmGetBelongingService(u32 connection_handle, u16 handle, BtmGattService *service, bool *flag) {
|
||||
Result btmGetBelongingService(u32 connection_handle, u16 attribute_handle, BtmGattService *service, bool *flag) {
|
||||
if (hosversionBefore(5,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
u32 cmd_id = hosversionBefore(5,1,0) ? 32 : 49;
|
||||
|
||||
const struct {
|
||||
u16 handle;
|
||||
u16 attribute_handle;
|
||||
u16 pad;
|
||||
u32 connection_handle;
|
||||
} in = { handle, 0, connection_handle };
|
||||
} in = { attribute_handle, 0, connection_handle };
|
||||
|
||||
u8 tmp=0;
|
||||
Result rc = serviceDispatchInOut(&g_btmSrv, cmd_id, in, tmp,
|
||||
@ -501,20 +501,20 @@ Result btmGetBelongingService(u32 connection_handle, u16 handle, BtmGattService
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result btmGetGattCharacteristics(u32 connection_handle, u16 handle, BtmGattCharacteristic *characteristics, u8 count, u8 *total_out) {
|
||||
Result btmGetGattCharacteristics(u32 connection_handle, u16 service_handle, BtmGattCharacteristic *characteristics, u8 count, u8 *total_out) {
|
||||
if (hosversionBefore(5,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
u32 cmd_id = hosversionBefore(5,1,0) ? 33 : 50;
|
||||
|
||||
return _btmGetGattServiceData(connection_handle, handle, characteristics, sizeof(BtmGattCharacteristic), count, total_out, cmd_id);
|
||||
return _btmGetGattServiceData(connection_handle, service_handle, characteristics, sizeof(BtmGattCharacteristic), count, total_out, cmd_id);
|
||||
}
|
||||
|
||||
Result btmGetGattDescriptors(u32 connection_handle, u16 handle, BtmGattDescriptor *descriptors, u8 count, u8 *total_out) {
|
||||
Result btmGetGattDescriptors(u32 connection_handle, u16 char_handle, BtmGattDescriptor *descriptors, u8 count, u8 *total_out) {
|
||||
if (hosversionBefore(5,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
u32 cmd_id = hosversionBefore(5,1,0) ? 34 : 51;
|
||||
|
||||
return _btmGetGattServiceData(connection_handle, handle, descriptors, sizeof(BtmGattDescriptor), count, total_out, cmd_id);
|
||||
return _btmGetGattServiceData(connection_handle, char_handle, descriptors, sizeof(BtmGattDescriptor), count, total_out, cmd_id);
|
||||
}
|
||||
|
||||
Result btmAcquireBleMtuConfigEvent(Event* out_event) {
|
||||
|
@ -124,12 +124,12 @@ Result btmuAcquireBleScanEvent(Event* out_event) {
|
||||
return _btmuCmdGetEventOutFlag(out_event, true, 0);
|
||||
}
|
||||
|
||||
Result btmuGetBleScanFilterParameter(u16 unk, BtdrvBleAdvertisePacketParameter *out) {
|
||||
return serviceDispatchInOut(&g_btmuIBtmUserCore, 1, unk, *out);
|
||||
Result btmuGetBleScanFilterParameter(u16 parameter_id, BtdrvBleAdvertisePacketParameter *out) {
|
||||
return serviceDispatchInOut(&g_btmuIBtmUserCore, 1, parameter_id, *out);
|
||||
}
|
||||
|
||||
Result btmuGetBleScanFilterParameter2(u16 unk, BtdrvGattAttributeUuid *out) {
|
||||
return serviceDispatchInOut(&g_btmuIBtmUserCore, 2, unk, *out);
|
||||
Result btmuGetBleScanFilterParameter2(u16 parameter_id, BtdrvGattAttributeUuid *out) {
|
||||
return serviceDispatchInOut(&g_btmuIBtmUserCore, 2, parameter_id, *out);
|
||||
}
|
||||
|
||||
Result btmuStartBleScanForGeneral(BtdrvBleAdvertisePacketParameter param) {
|
||||
@ -264,17 +264,17 @@ Result btmuGetGattService(u32 connection_handle, const BtdrvGattAttributeUuid *u
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result btmuGetGattIncludedServices(u32 connection_handle, u16 handle, BtmGattService *services, u8 count, u8 *out) {
|
||||
return _btmuGetGattServiceData(connection_handle, handle, services, sizeof(BtmGattService), count, out, 29);
|
||||
Result btmuGetGattIncludedServices(u32 connection_handle, u16 service_handle, BtmGattService *services, u8 count, u8 *out) {
|
||||
return _btmuGetGattServiceData(connection_handle, service_handle, services, sizeof(BtmGattService), count, out, 29);
|
||||
}
|
||||
|
||||
Result btmuGetBelongingGattService(u32 connection_handle, u16 handle, BtmGattService *service, bool *flag) {
|
||||
Result btmuGetBelongingGattService(u32 connection_handle, u16 attribute_handle, BtmGattService *service, bool *flag) {
|
||||
const struct {
|
||||
u16 handle;
|
||||
u16 attribute_handle;
|
||||
u16 pad;
|
||||
u32 connection_handle;
|
||||
u64 AppletResourceUserId;
|
||||
} in = { handle, 0, connection_handle, appletGetAppletResourceUserId() };
|
||||
} in = { attribute_handle, 0, connection_handle, appletGetAppletResourceUserId() };
|
||||
|
||||
u8 tmp=0;
|
||||
Result rc = serviceDispatchInOut(&g_btmuIBtmUserCore, 30, in, tmp,
|
||||
@ -286,12 +286,12 @@ Result btmuGetBelongingGattService(u32 connection_handle, u16 handle, BtmGattSer
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result btmuGetGattCharacteristics(u32 connection_handle, u16 handle, BtmGattCharacteristic *characteristics, u8 count, u8 *total_out) {
|
||||
return _btmuGetGattServiceData(connection_handle, handle, characteristics, sizeof(BtmGattCharacteristic), count, total_out, 31);
|
||||
Result btmuGetGattCharacteristics(u32 connection_handle, u16 service_handle, BtmGattCharacteristic *characteristics, u8 count, u8 *total_out) {
|
||||
return _btmuGetGattServiceData(connection_handle, service_handle, characteristics, sizeof(BtmGattCharacteristic), count, total_out, 31);
|
||||
}
|
||||
|
||||
Result btmuGetGattDescriptors(u32 connection_handle, u16 handle, BtmGattDescriptor *descriptors, u8 count, u8 *total_out) {
|
||||
return _btmuGetGattServiceData(connection_handle, handle, descriptors, sizeof(BtmGattDescriptor), count, total_out, 32);
|
||||
Result btmuGetGattDescriptors(u32 connection_handle, u16 char_handle, BtmGattDescriptor *descriptors, u8 count, u8 *total_out) {
|
||||
return _btmuGetGattServiceData(connection_handle, char_handle, descriptors, sizeof(BtmGattDescriptor), count, total_out, 32);
|
||||
}
|
||||
|
||||
Result btmuAcquireBleMtuConfigEvent(Event* out_event) {
|
||||
|
Loading…
Reference in New Issue
Block a user