00001 /* Copyright (c) 2010, Cedrus Corporation 00002 * All rights reserved. 00003 * 00004 * Redistribution and use in source and binary forms, with or without 00005 * modification, are permitted provided that the following conditions are 00006 * met: 00007 * 00008 * Redistributions of source code must retain the above copyright notice, 00009 * this list of conditions and the following disclaimer. 00010 * 00011 * Redistributions in binary form must reproduce the above copyright 00012 * notice, this list of conditions and the following disclaimer in the 00013 * documentation and/or other materials provided with the distribution. 00014 * 00015 * Neither the name of Cedrus Corporation nor the names of its 00016 * contributors may be used to endorse or promote products derived from 00017 * this software without specific prior written permission. 00018 * 00019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00020 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00021 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00022 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00023 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00024 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00025 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00026 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00027 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00028 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00029 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00030 */ 00031 00032 #ifndef xid_device_scanner_t_H 00033 #define xid_device_scanner_t_H 00034 00035 #include <vector> 00036 #include <string> 00037 #include <boost/shared_ptr.hpp> 00038 00039 namespace cedrus 00040 { 00041 class xid_con_t; 00042 00043 class xid_device_scanner_t 00044 { 00045 public: 00046 enum 00047 { 00048 MAX_PORTS = 255 00049 }; 00050 00051 xid_device_scanner_t(void); 00052 virtual ~xid_device_scanner_t(void); 00053 00062 int detect_valid_xid_devices(); 00063 00075 boost::shared_ptr<xid_con_t> response_device_connection_at_index(unsigned int i); 00076 00077 boost::shared_ptr<xid_con_t> stimtracker_connection_at_index(unsigned int i); 00078 00079 int rb_device_count() const; 00080 int st_device_count() const; 00081 00082 private: 00088 void load_available_com_ports(); 00089 00090 std::vector<std::wstring> available_com_ports_; 00091 std::vector<boost::shared_ptr<cedrus::xid_con_t> > rb_connections_; 00092 std::vector<boost::shared_ptr<cedrus::xid_con_t> > st_connections_; 00093 }; 00094 } // namespace cedrus 00095 00096 #endif // xid_device_scanner_t_H