#ifndef _VNSENSORS_SEARCHER_H_ #define _VNSENSORS_SEARCHER_H_ #include #include #include "int.h" #include "export.h" namespace vn { namespace sensors { /// \brief Helpful class for finding VectorNav sensors. class vn_proglib_DLLEXPORT Searcher { public: /// \brief Searches the serial port at all valid baudrates for a VectorNav /// sensor. /// /// \param[in] portName The serial port to search. /// \param[out] foundBuadrate If a sensor is found, this will be set to the /// baudrate the sensor is communicating at. /// \returns true if a sensor if found; otherwise false. static void findPorts(std::vector& portlist); /// \brief Searches the serial port at all valid baudrates for a VectorNav /// sensor. /// /// \param[in] portName The serial port to search. /// \param[out] foundBuadrate If a sensor is found, this will be set to the /// baudrate the sensor is communicating at. /// \returns true if a sensor if found; otherwise false. static bool search(const std::string &portName, int32_t *foundBaudrate); /// \brief Checks all available serial ports on the system for any /// VectorNav sensors. /// /// \return Collection of serial ports and baudrates for all found sensors. static std::vector > search(void); /// \brief Checks the provided list of serial ports for any connected /// VectorNav sensors. /// /// \param[in] portsToCheck List of serial ports to check for sensors. /// \return Collection of serial ports and baudrates for all found sensors. static std::vector > search(std::vector& portsToCheck); /// \brief Tests if a sensor is connected to the serial port at the /// specified baudrate. /// /// \param[in] portName The serial port to test. /// \param[in] baudrate The baudrate to test at. /// \returns true if a sensor if found; otherwise false. static bool test(std::string portName, uint32_t baudrate); }; } } #endif