Kallisto Linux API
Library for interacting with Kallisto devices
kallisto_helper.hpp
Go to the documentation of this file.
1 
42 #ifndef KALLISTO_HELPER_HPP
43 #define KALLISTO_HELPER_HPP
44 
45 #include <string>
46 #include <list>
47 #include <memory>
48 
49 #include "kallisto_impl.hpp"
50 
51 namespace kallisto {
52 namespace hardware {
53 
54 class KallistoHelper {
55 public:
63  static KallistoImpl* getKallistoWithAddress(const std::list<std::unique_ptr<hardware::KallistoImpl> >& device_list, std::string address){
64  for(auto it = device_list.begin(); it != device_list.end(); it++){
65  if((*it)->getAddress() == address){
66  return it->get();
67  }
68  }
69 
70  return nullptr;
71  }
72 
80  static KallistoImpl* getKallistoWithSensorHandle(const std::list<std::unique_ptr<hardware::KallistoImpl> >& device_list, unsigned int handle){
81  for(auto it = device_list.begin(); it != device_list.end(); it++){
82  if((*it)->getSensor(handle) != nullptr){
83  return it->get();
84  }
85  }
86 
87  return nullptr;
88  }
89 };
90 
91 } /* namespace hardware */
92 } /* namespace kallisto */
93 
94 
95 
96 #endif // KALLISTO_HELPER_HPP
Definition: kallisto_helper.hpp:53
static KallistoImpl * getKallistoWithAddress(const std::list< std::unique_ptr< hardware::KallistoImpl > > &device_list, std::string address)
Definition: kallisto_helper.hpp:62
Definition: bluetooth_adapter.hpp:52
Definition: kallisto_impl.hpp:70
static KallistoImpl * getKallistoWithSensorHandle(const std::list< std::unique_ptr< hardware::KallistoImpl > > &device_list, unsigned int handle)
Definition: kallisto_helper.hpp:79