Skip to content

Commit 60870e3

Browse files
committed
fw/services/bluetooth: use a different gap_bonding_db for formerly-Bluetopia devices
Just like we choked on gap_bonding_dbs from formerly-Bluetopia devices, formerly-Bluetopia devices may behave very strangely indeed on ours. On those devices, rename the bonding DB so it's not a problem. Fixes #253. Signed-off-by: Joshua Wise <[email protected]>
1 parent 80ebd9d commit 60870e3

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

platform/platform_capabilities.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
'USE_PARALLEL_FLASH',
5757
'HAS_PUTBYTES_PREACKING',
5858
'HAS_FLASH_OTP',
59+
'WAS_BLUETOPIA',
5960
}
6061

6162
board_capability_dicts = [
@@ -66,6 +67,7 @@
6667
'HAS_APPLE_MFI',
6768
'HAS_DEFECTIVE_FW_CRC',
6869
'HAS_MAGNETOMETER',
70+
'WAS_BLUETOPIA',
6971
},
7072
},
7173
{
@@ -76,6 +78,7 @@
7678
'HAS_DEFECTIVE_FW_CRC',
7779
'HAS_LED',
7880
'HAS_MAGNETOMETER',
81+
'WAS_BLUETOPIA',
7982
},
8083
},
8184
{
@@ -102,6 +105,7 @@
102105
'HAS_VIBE_SCORES',
103106
'USE_PARALLEL_FLASH',
104107
'HAS_WEATHER',
108+
'WAS_BLUETOPIA',
105109
},
106110
},
107111
{
@@ -129,6 +133,7 @@
129133
'HAS_VIBE_SCORES',
130134
'USE_PARALLEL_FLASH',
131135
'HAS_WEATHER',
136+
'WAS_BLUETOPIA',
132137
},
133138
},
134139
{
@@ -154,6 +159,7 @@
154159
'HAS_VIBE_SCORES',
155160
'USE_PARALLEL_FLASH',
156161
'HAS_WEATHER',
162+
'WAS_BLUETOPIA',
157163
},
158164
},
159165
{
@@ -179,6 +185,7 @@
179185
'HAS_VIBE_SCORES',
180186
'USE_PARALLEL_FLASH',
181187
'HAS_WEATHER',
188+
'WAS_BLUETOPIA',
182189
},
183190
},
184191
{

src/fw/services/normal/bluetooth/bluetooth_persistent_storage.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,14 @@ typedef struct PACKED {
8888
///////////////////////////////////////////////////////////////////////////////////////////////////
8989
//! Settings File
9090

91-
#define BT_PERSISTENT_STORAGE_FILE_NAME "gap_bonding_db"
91+
#if CAPABILITY_WAS_BLUETOPIA
92+
// Avoid making a mess with unreadable pairing names if someone downgrades
93+
// to a Bluetopia firmware -- we'll just store our bondings in an entirely
94+
// different database.
95+
#define BT_PERSISTENT_STORAGE_FILE_NAME "gap_bonding_db_v2"
96+
#else
97+
#define BT_PERSISTENT_STORAGE_FILE_NAME "gap_bonding_db"
98+
#endif
9299
#define BT_PERSISTENT_STORAGE_FILE_SIZE (4096)
93100

94101
//! All of the actual pairings use a BTBondingID as a key. This is because with BLE pairings an

0 commit comments

Comments
 (0)