From 2f6ea652d7549ffab8aacd7e7ef61ba7926bc15e Mon Sep 17 00:00:00 2001 From: ndeadly Date: Fri, 10 Mar 2023 18:06:38 +0100 Subject: [PATCH] Add system setting to mirror bluetooth pairing database to sd card (#1787) * ams_mitm: add ability to mirror bluetooth device pairing database to sd card via a system setting * ams_mitm: address requested stylistic changes * ams_mitm: make use of R_SUCCEED macro * ams_mitm: use settings::BluetoothDevicesSettings instead of libnx type * ams_mitm: fix logic error when truncating pairing database on read * Update .ini comment * ams_mitm: missing R_TRY around call to fs::FlushFile * stratosphere: remove union from BluetoothDevicesSettings type --------- Co-authored-by: ndeadly <24677491+ndeadly@users.noreply.github.com> --- .../stratosphere/settings/settings_types.hpp | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/libstratosphere/include/stratosphere/settings/settings_types.hpp b/libstratosphere/include/stratosphere/settings/settings_types.hpp index 8d6f3755..a0996f21 100644 --- a/libstratosphere/include/stratosphere/settings/settings_types.hpp +++ b/libstratosphere/include/stratosphere/settings/settings_types.hpp @@ -235,4 +235,29 @@ namespace ams::settings { return !(lhs <= rhs); } + struct BluetoothDevicesSettings : public sf::LargeData { + u8 address[0x6]; + char name[0x20]; + u8 class_of_device[0x3]; + u8 link_key[0x10]; + u8 link_key_present; + u16 version; + u32 trusted_services; + u16 vid; + u16 pid; + u8 sub_class; + u8 attribute_mask; + u16 descriptor_length; + u8 descriptor[0x80]; + u8 key_type; + u8 device_type; + u16 brr_size; + u8 brr[0x9]; + u8 reserved0; + char name2[0xF9]; + u8 reserved1[0x31]; + }; + + static_assert(sizeof(BluetoothDevicesSettings) == sizeof(::SetSysBluetoothDevicesSettings)); + }