Implement use of Inventory API
This commit is contained in:
+33
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user