diff --git a/debug-app/drivers/ir-driver/src/ir-driver.cpp b/debug-app/drivers/ir-driver/src/ir-driver.cpp index 6a4dd0094b316848c9533a89f737b0ae0c8646b9..97104aee3f78acefbd91d47e1e1a5cf88c7de9cf 100644 --- a/debug-app/drivers/ir-driver/src/ir-driver.cpp +++ b/debug-app/drivers/ir-driver/src/ir-driver.cpp @@ -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); diff --git a/debug-app/include/ble-scanner.h b/debug-app/include/ble-scanner.h index 85b7bcc9e3a9b7e061c4b4d3e7ab15c0805615a7..446ec2cf09bbb2e257abffdecf4c759288a85ba7 100644 --- a/debug-app/include/ble-scanner.h +++ b/debug-app/include/ble-scanner.h @@ -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