You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

30 lines
711 B

#include "esp_gatts_api.h"
#include "esp_log.h"
#include "esp_system.h"
#include "freertos/FreeRTOS.h"
#include "freertos/event_groups.h"
#include "freertos/task.h"
#include "nvs_flash.h"
#include "string.h"
//
#include "ble_spp_server_demo.h"
uint16_t table_conn_id_m;
esp_gatt_if_t table_gatts_if_m;
uint16_t table_handle_m;
void app_main(void) {
ble_spp_server_demo_app_main(&table_conn_id_m, &table_gatts_if_m, &table_handle_m);
char temp_buffer[5] = {'1', '2', '3', '4', '5'};
while (true) {
if (table_handle_m != 0) {
ets_delay_us(1000000);
esp_ble_gatts_send_indicate(table_gatts_if_m, table_conn_id_m, table_handle_m, 5, (uint8_t *)temp_buffer, false);
}
}
return;
}