2024-05-07 14:33:37 -05:00
|
|
|
esp32_ble_server:
|
2024-10-19 13:09:41 +02:00
|
|
|
id: ble_server
|
2024-05-07 14:33:37 -05:00
|
|
|
manufacturer_data: [0x72, 0x4, 0x00, 0x23]
|
2024-06-27 22:07:36 +02:00
|
|
|
manufacturer: ESPHome
|
|
|
|
model: Test
|
2024-10-19 20:00:19 +02:00
|
|
|
on_connect:
|
|
|
|
- lambda: |-
|
|
|
|
ESP_LOGD("BLE", "Connection from %d", id);
|
|
|
|
on_disconnect:
|
|
|
|
- lambda: |-
|
|
|
|
ESP_LOGD("BLE", "Disconnection from %d", id);
|
2024-06-27 22:07:36 +02:00
|
|
|
services:
|
2024-10-19 20:00:19 +02:00
|
|
|
- uuid: 2a24b789-7aab-4535-af3e-ee76a35cc12d
|
2024-06-27 22:07:36 +02:00
|
|
|
advertise: false
|
|
|
|
characteristics:
|
2024-07-12 23:30:42 +02:00
|
|
|
- id: test_notify_characteristic
|
2024-10-19 20:00:19 +02:00
|
|
|
description: "Notify characteristic"
|
2024-07-12 23:30:42 +02:00
|
|
|
uuid: cad48e28-7fbe-41cf-bae9-d77a6c233423
|
|
|
|
read: true
|
|
|
|
notify: true
|
2024-10-19 20:00:19 +02:00
|
|
|
value: [9, 9, 9]
|
2024-07-12 23:30:42 +02:00
|
|
|
descriptors:
|
|
|
|
- uuid: cad48e28-7fbe-41cf-bae9-d77a6c111111
|
|
|
|
value: 123.1
|
2024-10-19 13:09:41 +02:00
|
|
|
byte_length: 100
|
2024-06-27 22:07:36 +02:00
|
|
|
- uuid: 2a24b789-7a1b-4535-af3e-ee76a35cc42d
|
|
|
|
advertise: false
|
|
|
|
characteristics:
|
2024-06-28 00:07:17 +02:00
|
|
|
- id: test_change_characteristic
|
2024-10-19 20:00:19 +02:00
|
|
|
uuid: 2a24b789-7a1b-4535-af3e-ee76a35cc11c
|
2024-07-12 23:30:42 +02:00
|
|
|
read: true
|
2024-06-28 00:07:17 +02:00
|
|
|
value: "Initial"
|
2024-10-19 20:00:19 +02:00
|
|
|
description: "Change characteristic"
|
2024-10-19 13:09:41 +02:00
|
|
|
descriptors:
|
2024-10-19 20:00:19 +02:00
|
|
|
- uuid: 0x2312
|
2024-10-19 13:09:41 +02:00
|
|
|
value: 0x12
|
2024-10-19 20:00:19 +02:00
|
|
|
on_write:
|
|
|
|
- lambda: |-
|
|
|
|
ESP_LOGD("BLE", "Descriptor received: %s from %d", std::string(x.begin(), x.end()).c_str(), id);
|
|
|
|
- uuid: 2a24b789-7a1b-4535-af3e-ee76a35cc99a
|
2024-07-12 23:30:42 +02:00
|
|
|
write: true
|
2024-06-27 22:07:36 +02:00
|
|
|
on_write:
|
|
|
|
then:
|
|
|
|
- lambda: |-
|
2024-10-19 20:00:19 +02:00
|
|
|
ESP_LOGD("BLE", "Characteristic received: %s from %d", std::string(x.begin(), x.end()).c_str(), id);
|
2024-07-12 23:30:42 +02:00
|
|
|
- ble_server.characteristic.set_value:
|
2024-06-28 00:07:17 +02:00
|
|
|
id: test_change_characteristic
|
2024-11-01 12:24:56 +11:00
|
|
|
value: !lambda 'return bytebuffer::ByteBuffer::wrap({0x00, 0x01, 0x02}).get_data();'
|
|
|
|
- ble_server.characteristic.set_value:
|
|
|
|
id: test_change_characteristic
|
|
|
|
value: [1, 2, 3, 4]
|
2024-07-12 23:30:42 +02:00
|
|
|
- ble_server.characteristic.notify:
|
|
|
|
id: test_notify_characteristic
|