| 272 | } |
| 273 | |
| 274 | void executeCustomSpam(String spamName) { |
| 275 | uint8_t macAddr[6]; |
| 276 | for (int i = 0; i < 6; i++) { macAddr[i] = esp_random() & 0xFF; } |
| 277 | macAddr[0] = (macAddr[0] | 0xF0) & 0xFE; |
| 278 | esp_iface_mac_addr_set(macAddr, ESP_MAC_BT); |
| 279 | |
| 280 | BLEDevice::init("sh4rk"); |
| 281 | vTaskDelay(5 / portTICK_PERIOD_MS); |
| 282 | esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, MAX_TX_POWER); |
| 283 | pAdvertising = BLEDevice::getAdvertising(); |
| 284 | BLEAdvertisementData advertisementData = BLEAdvertisementData(); |
| 285 | |
| 286 | advertisementData.setFlags(0x06); |
| 287 | advertisementData.setName(spamName.c_str()); |
| 288 | pAdvertising->addServiceUUID(BLEUUID("1812")); |
| 289 | pAdvertising->setAdvertisementData(advertisementData); |
| 290 | pAdvertising->start(); |
| 291 | vTaskDelay(20 / portTICK_PERIOD_MS); |
| 292 | pAdvertising->stop(); |
| 293 | vTaskDelay(5 / portTICK_PERIOD_MS); |
| 294 | #if defined(CONFIG_IDF_TARGET_ESP32C5) |
| 295 | esp_bt_controller_deinit(); |
| 296 | #else |
| 297 | BLEDevice::deinit(); |
| 298 | #endif |
| 299 | } |
| 300 | |
| 301 | void ibeacon(const char *DeviceName, const char *BEACON_UUID, int ManufacturerId) { |
| 302 | uint8_t macAddr[6]; |