Skip to content
Snippets Groups Projects
Commit c8cf06aa authored by DAsamhan's avatar DAsamhan
Browse files

change IR driver logic

parent 5270f578
1 merge request!6Implement main application
......@@ -11,7 +11,7 @@ static IrDriver *context;
IrDriver::IrDriver(){
context = this;
int err = gpio_pin_configure_dt(&irSensorNode, GPIO_INPUT);
gpio_pin_interrupt_configure_dt(&irSensorNode, GPIO_INT_EDGE_RISING);
gpio_pin_interrupt_configure_dt(&irSensorNode, GPIO_INT_EDGE_BOTH);
gpio_init_callback(&irSensorCb, InterruptCallback, BIT(irSensorNode.pin));
gpio_add_callback(irSensorNode.port, &irSensorCb);
......
......@@ -6,6 +6,12 @@
#include <string>
#include <vector>
typedef struct RawBleData {
std::string addrStr;
std::vector<uint8_t> bleData;
int8_t rssi;
} RawBleData_t;
class BleScanner {
public:
/** Constructor.
......@@ -24,11 +30,20 @@ public:
void SetScan(bool enable);
RawBleData_t GetLatestData();
private:
std::string currAddr;
std::vector<uint8_t> currData;
int8_t currRssi;
struct k_work bleWork;
void (*registeredCallback)(std::string, std::vector<uint8_t>, int8_t) = NULL;
static void BleDevicefound(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, struct net_buf_simple *ad);
static void BleInterruptHandler(struct k_work *item);
};
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment