mirror of
https://github.com/ndeadly/MissionControl
synced 2024-12-18 00:23:12 +00:00
122 lines
3.6 KiB
C
122 lines
3.6 KiB
C
#include "btdrv_shim.h"
|
|
#include <stratosphere/sf/sf_mitm_dispatch.h>
|
|
|
|
Result btdrvInitializeBluetoothFwd(Service* s, Handle *out_handle) {
|
|
return serviceMitmDispatch(s, 1,
|
|
.out_handle_attrs = { SfOutHandleAttr_HipcCopy },
|
|
.out_handles = out_handle,
|
|
);
|
|
}
|
|
|
|
Result btdrvFinalizeBluetoothFwd(Service* s) {
|
|
return serviceMitmDispatch(s, 4);
|
|
}
|
|
|
|
/*
|
|
Result btdrvCancelBondFwd(Service* s, const BluetoothAddress *address) {
|
|
const struct {
|
|
BluetoothAddress address;
|
|
} in = { *address };
|
|
|
|
return serviceMitmDispatchIn(s, 12, in);
|
|
}
|
|
*/
|
|
|
|
/*
|
|
Result btdrvGetEventInfoFwd(Service* s, BluetoothEventType *type, u8 *buffer, size_t size) {
|
|
return serviceMitmDispatchOut(s, 15, *type,
|
|
.buffer_attrs = { SfBufferAttr_HipcPointer | SfBufferAttr_Out },
|
|
.buffers = { {buffer, size} }
|
|
);
|
|
}
|
|
*/
|
|
|
|
Result btdrvInitializeHidFwd(Service* s, Handle *out_handle, u16 version) {
|
|
return serviceMitmDispatchIn(s, 16, version,
|
|
.out_handle_attrs = { SfOutHandleAttr_HipcCopy },
|
|
.out_handles = out_handle,
|
|
);
|
|
}
|
|
|
|
Result btdrvWriteHidDataFwd(Service* s, const BluetoothAddress *address, const BluetoothHidData *data) {
|
|
const struct {
|
|
BluetoothAddress address;
|
|
} in = { *address };
|
|
|
|
return serviceMitmDispatchIn(s, 19, in,
|
|
.buffer_attrs = { SfBufferAttr_FixedSize | SfBufferAttr_HipcPointer | SfBufferAttr_In },
|
|
.buffers = { {data, sizeof(BluetoothHidData)} }
|
|
);
|
|
}
|
|
|
|
|
|
/*
|
|
Result btdrvGetPairedDeviceInfoFwd(Service* s, const BluetoothAddress *address, BluetoothDevicesSettings *device) {
|
|
const struct {
|
|
BluetoothAddress address;
|
|
} in = { *address };
|
|
|
|
return serviceMitmDispatchIn(s, 25, in,
|
|
.buffer_attrs = { SfBufferAttr_FixedSize | SfBufferAttr_HipcPointer | SfBufferAttr_Out },
|
|
.buffers = { {device, sizeof(BluetoothDevicesSettings)} }
|
|
);
|
|
}
|
|
*/
|
|
|
|
|
|
Result btdrvFinalizeHidFwd(Service* s) {
|
|
return serviceMitmDispatch(s, 26);
|
|
}
|
|
|
|
/*
|
|
Result btdrvGetHidEventInfoFwd(Service* s, HidEventType *type, u8 *buffer, size_t size) {
|
|
return serviceMitmDispatchOut(s, 27, *type,
|
|
.buffer_attrs = { SfBufferAttr_HipcPointer | SfBufferAttr_Out },
|
|
.buffers = { {buffer, size} }
|
|
);
|
|
}
|
|
*/
|
|
|
|
Result btdrvRegisterHidReportEventFwd(Service* s, Handle *out_handle) {
|
|
return serviceMitmDispatch(s, hosversionBefore(4, 0, 0) ? 36 : 37,
|
|
.out_handle_attrs = { SfOutHandleAttr_HipcCopy },
|
|
.out_handles = out_handle,
|
|
);
|
|
}
|
|
|
|
Result btdrvGetHidReportEventInfoDeprecatedFwd(Service* s, HidEventType *type, u8 *buffer, size_t size) {
|
|
return serviceMitmDispatchOut(s, hosversionBefore(4, 0, 0) ? 37 : 38, *type,
|
|
.buffer_attrs = { SfBufferAttr_HipcPointer | SfBufferAttr_Out },
|
|
.buffers = { {buffer, size} }
|
|
);
|
|
}
|
|
|
|
Result btdrvGetHidReportEventInfoFwd(Service* s, Handle *out_handle) {
|
|
return serviceMitmDispatch(s, 38,
|
|
.out_handle_attrs = { SfOutHandleAttr_HipcCopy },
|
|
.out_handles = out_handle,
|
|
);
|
|
}
|
|
|
|
Result btdrvInitializeBleFwd(Service* s, Handle *out_handle) {
|
|
return serviceMitmDispatch(s, 46,
|
|
.out_handle_attrs = { SfOutHandleAttr_HipcCopy },
|
|
.out_handles = out_handle,
|
|
);
|
|
}
|
|
|
|
Result btdrvFinalizeBleFwd(Service* s) {
|
|
return serviceMitmDispatch(s, 49);
|
|
}
|
|
|
|
/*
|
|
Result btdrvGetBleManagedEventInfoFwd(Service* s, BleEventType *type, u8 *buffer, u16 length) {
|
|
if (hosversionBefore(5, 0, 0))
|
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
|
|
|
return serviceDispatchOut(s, hosversionBefore(5, 1, 0) ? 78 : 79, *type,
|
|
.buffer_attrs = { SfBufferAttr_HipcPointer | SfBufferAttr_Out },
|
|
.buffers = { {buffer, length} }
|
|
);
|
|
}
|
|
*/
|