File: FindDeviceEthernet.h

package info (click to toggle)
libapogee3 3.2%2B20221221183454-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 9,284 kB
  • sloc: cpp: 26,737; sh: 8; makefile: 3
file content (79 lines) | stat: -rw-r--r-- 2,567 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*! 
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright(c) 2009 Apogee Instruments, Inc. 
* \class FindDeviceEthernet 
* \brief Class that tries to find apogee devices on the ethernet.
* 
*/ 


#ifndef FINDDEVICEETHERNET_INCLUDE_H__ 
#define FINDDEVICEETHERNET_INCLUDE_H__ 


#include <string>
#include <stdint.h>
#include "DefDllExport.h"

class UdpSocketBase;

class DLL_EXPORT FindDeviceEthernet 
{ 
    public: 

        /*! 
         */
        FindDeviceEthernet();

        /*! 
         */
        virtual ~FindDeviceEthernet(); 


        /*! 
         * Start search for Apogee ethernet device on a particular subnet
         * \param [in]  subnet Subnet address to search, 192.168.0.255 for example.
         * \return Returns a <d></d> demlited string with the ethernet devices found .  A
         * null string of <d></d> is returned if no device is found. Example of one camera string 
         * \verbatim <d>address=192.168.0.20,interface=ethernet,port=80,mac=0009510000FF,deviceType=camera,id=0xfeff,firmwareRev=0x0</d> \endverbatim
         */
        std::string Find(const std::string & subnet);

         /*! 
         * Returns The number of seconds the search has taken
         */
        int32_t GetElapsedSecs();

         /*! 
         * Returns Socket time out value
         */
        int32_t GetTimeout();
    private:
        std::string MakeDeviceStr(const std::string & input);
        void GetId( const std::string & input, std::string & id );
        void GetFirmwareRev( const std::string & input, std::string & firmwareRev );
        void GetIpAddr( const std::string & input, std::string & ipAddr );
        void GetPort( const std::string & input, std::string & port );
        void GetMacAddr( const std::string & input, std::string & mac );
        void GetInterfaceStatus( const std::string & input, std::string & interfaceStatus );
        std::string CameraInfo(const std::string & rawIdStr, 
                                           const std::string & frmwRevStr);

        const std::string m_fileName;
        const std::string m_CamResponse;
        UdpSocketBase * m_socketPtr;


        //disabling the copy ctor and assignment operator
        //generated by the compiler - don't want them
        //Effective C++ Item 6
        FindDeviceEthernet(const FindDeviceEthernet&);
        FindDeviceEthernet& operator=(FindDeviceEthernet&);


}; 

#endif