code cleanup
Some checks failed
ESP-IDF Build / build (esp32c6, release-v5.4) (push) Has been cancelled
ESP-IDF Build / build (esp32c6, release-v5.5) (push) Has been cancelled
ESP-IDF Build / build (esp32s3, release-v5.4) (push) Has been cancelled
ESP-IDF Build / build (esp32s3, release-v5.5) (push) Has been cancelled

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2025-12-20 20:41:55 +01:00
parent 387b9d4c65
commit e16cfbd03c
68 changed files with 927 additions and 74637 deletions

View File

@@ -0,0 +1,15 @@
#pragma once
#include "ble_device.h"
#ifdef __cplusplus
extern "C"
{
#endif
void ble_connect(device_info_t *device);
void ble_clear_bonds(void);
void ble_clear_bond(const ble_addr_t *addr);
void read_characteristic(uint16_t char_val_handle);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,24 @@
#pragma once
#include <host/ble_hs.h>
#include <host/util/util.h>
#include <nimble/nimble_port.h>
#include <nimble/nimble_port_freertos.h>
#include <stdint.h>
// Structure to cache device data
typedef struct
{
ble_addr_t addr;
uint16_t manufacturer_id;
uint8_t manufacturer_data[31]; // Max. length of manufacturer data
uint8_t manufacturer_data_len;
char name[32];
uint16_t service_uuids_16[10]; // Up to 10 16-bit Service UUIDs
uint8_t service_uuids_16_count;
ble_uuid128_t service_uuids_128[5]; // Up to 5 128-bit Service UUIDs
uint8_t service_uuids_128_count;
bool has_manufacturer;
bool has_name;
int8_t rssi;
} device_info_t;

View File

@@ -0,0 +1,14 @@
#pragma once
#include "ble_device.h"
#ifdef __cplusplus
extern "C"
{
#endif
void start_scan(void);
int get_device_count(void);
device_info_t *get_device(int index);
#ifdef __cplusplus
}
#endif