io_scanner.h
Go to the documentation of this file.
00001 
00026 #ifndef ODVA_ETHERNETIP_IO_SCANNER_H
00027 #define ODVA_ETHERNETIP_IO_SCANNER_H
00028 
00029 #include <string>
00030 #include <boost/array.hpp>
00031 #include <boost/asio.hpp>
00032 
00033 #include "odva_ethernetip/eip_types.h"
00034 
00035 using std::string;
00036 using boost::asio::ip::udp;
00037 
00038 namespace eip {
00039 
00043 class IOScanner
00044 {
00045 public:
00046   IOScanner(boost::asio::io_service& io_service, string hostname);
00047 
00048   virtual ~IOScanner()
00049   {
00050     socket_.close();
00051   }
00052 
00056   void sendListIdentityRequest();
00057 
00061   void handleListIdentityResponse(const boost::system::error_code& ec,
00062     std::size_t num_bytes);
00063 
00067   void run();
00068 
00069 private:
00070   string hostname_;
00071   udp::socket socket_;
00072   udp::endpoint device_endpoint_;
00073   boost::array<EIP_BYTE, 4*1024> recv_buf_;
00074 };
00075 
00076 } // namespace eip
00077 
00078 #endif  // ODVA_ETHERNETIP_IO_SCANNER_H


odva_ethernetip
Author(s): Kareem Shehata
autogenerated on Sat Jun 8 2019 20:21:23