Implement use of Inventory API

This commit is contained in:
2019-04-23 11:41:34 +02:00
parent ea71693886
commit 5724bd45a7
9 changed files with 184 additions and 62 deletions
+33 -2
View File
@@ -1,3 +1,4 @@
#include <iostream>
#include <string>
#include <stdio.h>
@@ -16,6 +17,8 @@
#include <bluetooth/hci_lib.h>
#include <bluetooth/l2cap.h>
#include "Util/Timer.h"
/* Defaults */
static bdaddr_t bdaddr;
static int size = 44;
@@ -224,13 +227,41 @@ error:
exit(1);
}
void print()
{
std::cout << "Print" << std::endl;
}
int main(int /*argc*/, char** /*argv[]*/)
{
std::string address = "48:4B:AA:85:30:C5";
ping(address.c_str());
//std::string address = "48:4B:AA:85:30:C5";
//ping(address.c_str());
//address = "d0:c5:f3:84:99:de";
//ping(address.c_str());
PresenceDetection::Util::Timer timer;
std::function<void()> f_print = print;
std::cout << "---" << std::endl;
timer.StartContinuous(1000, f_print);
timer.Stop();
timer.Wait();
std::cout << "---" << std::endl << std::endl;
std::cout << "---" << std::endl;
timer.StartContinuous(3000, f_print);
timer.Abort();
timer.Wait();
std::cout << "---" << std::endl << std::endl;
std::cout << "---" << std::endl;
timer.StartContinuous(3000, f_print);
sleep(1);
timer.Abort();
timer.Wait();
std::cout << "---" << std::endl << std::endl;
return 0;
}