Skip to content

Commit

Permalink
Update flipper-BLE.html
Browse files Browse the repository at this point in the history
Updated code for researchers.
  • Loading branch information
Techryptic committed Sep 13, 2023
1 parent 2f54a9f commit c51445d
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions _includes/flipper-BLE.html
Expand Up @@ -73,16 +73,11 @@
<div class="container">
<select id="colorSelector">
<option value="Device Type" disabled selected>Select Device Type</option>
<option value="0x1E, 0xFF, 0x4C, 0x00, 0x07, 0x19, 0x05, 0x00, 0x55, 0x10, 0x00, 0x00, 0x01, 0x06, 0xf6, 0x85, 0xda, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
status = aci_gap_update_adv_data(0x1F, choiceSelection);">Apple AirTag</option>
<option value="0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x20, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc0, 0x13, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
status = aci_gap_update_adv_data(0x17, choiceSelection);">Apple Keyboard</option>
<option value="0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x20, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc0, 0x02, 0x60, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
status = aci_gap_update_adv_data(0x17, choiceSelection);">Apple Transfer Number Notification</option>
<option value="0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x20, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc0, 0x09, 0x60, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
status = aci_gap_update_adv_data(0x17, choiceSelection);">Apple Set Up New iPhone Notification</option>
<option value="0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x20, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc0, 0x27, 0x60, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
status = aci_gap_update_adv_data(0x17, choiceSelection);">Apple Join This Apple TV Notification</option>
<option value="0x07, 0x19, 0x05, 0x00, 0x55, 0x10, 0x00, 0x00, 0x01, 0x06, 0xf6, 0x85, 0xda, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00">Apple AirTag</option>
<option value="0x04, 0x04, 0x20, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc0, 0x13, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00">Apple Keyboard</option>
<option value="0x04, 0x04, 0x20, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc0, 0x02, 0x60, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00">Apple Transfer Number Notification</option>
<option value="0x04, 0x04, 0x20, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc0, 0x09, 0x60, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00">Apple Set Up New iPhone Notification</option>
<option value="0x04, 0x04, 0x20, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc0, 0x27, 0x60, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00">Apple Join This Apple TV Notification</option>
</select>

<!-- Hidden code box -->
Expand Down Expand Up @@ -596,6 +591,35 @@
<!-- Hidden code box -->
<div id="hiddenCode2" style="display:none;">

};

uint8_t advDataSize = sizeof(choiceSelection);

// Create a new array with 0xff, 0x4c, 0x00, and the contents of choiceSelection
uint8_t completeAdvertisement[advDataSize + 3];
completeAdvertisement[0] = 0xff; // Manufacturer
completeAdvertisement[1] = 0x4c; // Apple Inc.
completeAdvertisement[2] = 0x00;
for (int i = 0; i < advDataSize; i++) {
completeAdvertisement[i + 3] = choiceSelection[i];
}

// Calculate the size of the completeAdvertisement array
uint8_t completeAdvDataSize = sizeof(completeAdvertisement);

// Create a new array to hold both completeAdvertisement and its size
uint8_t finalData[completeAdvDataSize + 1];
finalData[0] = completeAdvDataSize;

// Copy completeAdvertisement to finalData
for (int i = 0; i < completeAdvDataSize; i++) {
finalData[i + 1] = completeAdvertisement[i];
}

uint8_t finalDataSize = sizeof(finalData);
//uint8_t advDataSize = sizeof(choiceSelection);
status = aci_gap_update_adv_data(finalDataSize, finalData);

gap->state = new_state;
GapEvent event = {.type = GapEventTypeStartAdvertising
};
Expand Down

0 comments on commit c51445d

Please sign in to comment.