diff --git a/ReadMe.md b/ReadMe.md index 95a88f2537f..66e1b91d000 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -51,6 +51,7 @@ This software is for experimental purposes only and is not meant for any illegal - Added: [NFC: add MIFARE MINI support #2307 (By giacomoferretti)](https://github.com/flipperdevices/flipperzero-firmware/pull/2307) - Added: [NFC Magic: Add support for Gen4 "ultimate card" in Magic app #2238 (By nullableVoidPtr)](https://github.com/flipperdevices/flipperzero-firmware/pull/2238) - Updated: [Calculator "2" (By theCow61)](https://github.com/theCow61/calculator) +- Reverted: Bluetooth: Works as an AirTag [(Thanks to culturally)](https://github.com/culturally/flipper-zero-airtag) diff --git a/firmware/targets/f7/ble_glue/gap.c b/firmware/targets/f7/ble_glue/gap.c index 7382cb979a1..8ef037d6b72 100644 --- a/firmware/targets/f7/ble_glue/gap.c +++ b/firmware/targets/f7/ble_glue/gap.c @@ -370,8 +370,6 @@ static void gap_init_svc(Gap* gap) { } static void gap_advertise_start(GapState new_state) { - FURI_LOG_E(TAG, "gap_advertise_start"); - tBleStatus status; uint16_t min_interval; uint16_t max_interval; @@ -396,16 +394,6 @@ static void gap_advertise_start(GapState new_state) { FURI_LOG_D(TAG, "set_non_discoverable success"); } } - - static const uint16_t gap_appearance = 0x0000; //GAP_APPEARANCE_UNKNOWN - - status = aci_gatt_update_char_value( - gap->service.gap_svc_handle, - gap->service.gap_svc_handle, - 0, - sizeof(gap_appearance), - (uint8_t*)&gap_appearance); - // Configure advertising status = aci_gap_set_discoverable( ADV_IND, @@ -413,23 +401,15 @@ static void gap_advertise_start(GapState new_state) { max_interval, PUBLIC_ADDR, 0, - 0, - NULL, // Do not use a local name - 0, - NULL, // Do not include the service UUID list + strlen(gap->service.adv_name), + (uint8_t*)gap->service.adv_name, + gap->service.adv_svc_uuid_len, + gap->service.adv_svc_uuid, 0, 0); - - status = aci_gap_delete_ad_type(AD_TYPE_FLAGS); //Remove AD to free advertising buffer - status = aci_gap_delete_ad_type(AD_TYPE_TX_POWER_LEVEL); //Remove AD to free advertising buffer - - const uint8_t airtag_adv[] = {//Data to be advertise simulating AirTag package - 0x1E, 0xFF, 0x4C, 0x00, 0x12, 0x19, 0x10, 0x12, 0x12, 0x34, - 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, - 0x78, 0x90, 0x12, 0x34, 0x56, 0x12, 0x34, 0x56, 0x12, 0x45}; - - status = aci_gap_update_adv_data(0x1F, airtag_adv); //Update advertising data - + if(status) { + FURI_LOG_E(TAG, "set_discoverable failed %d", status); + } gap->state = new_state; GapEvent event = {.type = GapEventTypeStartAdvertising}; gap->on_event_cb(event, gap->context); @@ -586,4 +566,4 @@ static int32_t gap_app(void* context) { } return 0; -} \ No newline at end of file +}