| 82 | }; |
| 83 | |
| 84 | BLEAdvertisementData getAdvertismentData() { |
| 85 | BLEAdvertisementData oAdvertisementData = BLEAdvertisementData(); |
| 86 | |
| 87 | if (device_choice == 0) { |
| 88 | oAdvertisementData.addData(std::string((char*)DEVICES[device_index], 31)); |
| 89 | } |
| 90 | |
| 91 | |
| 92 | int adv_type_choice = random(3); |
| 93 | if (adv_type_choice == 0) { |
| 94 | pAdvertising->setAdvertisementType(ADV_TYPE_IND); |
| 95 | } else if (adv_type_choice == 1) { |
| 96 | pAdvertising->setAdvertisementType(ADV_TYPE_SCAN_IND); |
| 97 | } else { |
| 98 | pAdvertising->setAdvertisementType(ADV_TYPE_NONCONN_IND); |
| 99 | } |
| 100 | |
| 101 | return oAdvertisementData; |
| 102 | } |
| 103 | |
| 104 | void updateDisplay() { |
| 105 | u8g2.clearBuffer(); |