Skip to content

Commit

Permalink
fix placeholders and beacon stop on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewKuKanich committed Mar 8, 2024
1 parent 13fe7b3 commit 2a105e4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
34 changes: 28 additions & 6 deletions applications/system/findmy/findmy.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static void findmy_start(FindMy* app) {
app->config.adv_power_level = GapAdvPowerLevel_0dBm + app->transmit_power;
app->config.address_type = GapAddressTypePublic;

uint8_t mac[EXTRA_BEACON_MAC_ADDR_SIZE] = {0x4D, 0x61, 0x74, 0x4B, 0x75, 0x4B};
uint8_t mac[EXTRA_BEACON_MAC_ADDR_SIZE] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66};
furi_hal_bt_reverse_mac_addr(mac);
memcpy(&app->config.address, mac, sizeof(app->config.address));
furi_check(furi_hal_bt_extra_beacon_set_config(&app->config));
Expand All @@ -92,15 +92,37 @@ static void findmy_start(FindMy* app) {
uint8_t* it = data;

// For Apple AirTags
*it++ = 0x1E; // Length
*it++ = 0x1E, // Length
*it++ = 0xFF; // Manufacturer Specific Data
*it++ = 0x4C; // Company ID (Apple, Inc.)
*it++ = 0x00; // State
*it++ = 0x12; // Data - Public Key without the MAC address
*it++ = 0x81; // ...
*it++ = 0xB9; // ...
*it++ = 0x02; // First 2 bits are the version, the rest is the battery level
*it++ = 0x7E; // Hint (0x00)
*it++ = 0x19;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00;
*it++ = 0x00; // First 2 bits are the version, the rest is the battery level
*it++ = 0x00; // Hint (0x00)

furi_check(furi_hal_bt_extra_beacon_set_data(data, it - data));
}
Expand Down
1 change: 1 addition & 0 deletions applications/system/findmy/scenes/findmy_scene_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ bool findmy_scene_main_on_event(void* context, SceneManagerEvent event) {
void findmy_scene_main_on_exit(void* context) {
FindMy* app = context;
UNUSED(app);
furi_hal_bt_extra_beacon_stop();
}

1 comment on commit 2a105e4

@Willy-JL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before anyone makes false accusations (you know who you are), these previous values contained no identifiable data. the packet was incomplete and non-working.

Please sign in to comment.