forked from paulh002/sdrberry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathble_interface.h
More file actions
52 lines (48 loc) · 1.19 KB
/
ble_interface.h
File metadata and controls
52 lines (48 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
#include <tinyb.hpp>
#include "lvgl/lvgl.h"
#include <tinyb.hpp>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <cerrno>
#include <array>
#include <iomanip>
#include <vector>
#include <iostream>
#include <thread>
#include <atomic>
#include <csignal>
#include <signal.h>
#include "vfo.h"
#include "RtAudio.h"
#include "Audiodefs.h"
#include "DataBuffer.h"
#include "AudioOutput.h"
#include "AudioInput.h"
#include "sdrberry.h"
#include <stdexcept>
class ble_class
{
public:
ble_class() {};
~ble_class();
int setup_ble();
std::unique_ptr <BluetoothDevice> sensor_tag;
int connect();
void set_mac_address(string mac) {to_upper(mac); m_mac_address = mac; }
bool is_connected() {return m_connected;}
void operator()();
private:
BluetoothManager *manager = nullptr;
std::unique_ptr<BluetoothGattService> encoder_service;
std::unique_ptr<BluetoothGattCharacteristic> encoder_value;
std::string value_uuid;
bool m_connected = false;
std::string m_mac_address;
};
extern ble_class Ble_instance;
int create_ble_thread(string mac_addres);