2020-04-23 18:02:28 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
2023-02-03 08:50:10 -06:00
|
|
|
#include "BluetoothCommon.h"
|
2023-01-21 15:07:30 +01:00
|
|
|
#include <Arduino.h>
|
|
|
|
|
|
2023-02-03 08:50:10 -06:00
|
|
|
class NRF52Bluetooth : BluetoothApi
|
2020-04-23 18:02:28 -07:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
void setup();
|
2020-10-30 17:05:32 +08:00
|
|
|
void shutdown();
|
2024-06-12 23:34:00 +12:00
|
|
|
void startDisabled();
|
2024-05-03 22:49:22 +02:00
|
|
|
void resumeAdvertising();
|
2022-02-01 18:32:26 -06:00
|
|
|
void clearBonds();
|
2023-02-03 08:50:10 -06:00
|
|
|
bool isConnected();
|
|
|
|
|
int getRssi();
|
2024-07-07 04:50:47 -07:00
|
|
|
void sendLog(const uint8_t *logMessage, size_t length);
|
2020-04-23 18:02:28 -07:00
|
|
|
|
2022-08-22 16:41:23 -05:00
|
|
|
private:
|
|
|
|
|
static void onConnectionSecured(uint16_t conn_handle);
|
|
|
|
|
static bool onPairingPasskey(uint16_t conn_handle, uint8_t const passkey[6], bool match_request);
|
|
|
|
|
static void onPairingCompleted(uint16_t conn_handle, uint8_t auth_status);
|
2025-04-18 10:11:42 +12:00
|
|
|
|
|
|
|
|
static bool onUnwantedPairing(uint16_t conn_handle, uint8_t const passkey[6], bool match_request);
|
|
|
|
|
static void disconnect();
|
2024-03-03 13:56:55 -06:00
|
|
|
};
|