DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DeviceManager.hpp
Go to the documentation of this file.
1
8#ifndef SSPMODULES_SRC_ANLBOARD_DEVICEMANAGER_HPP_
9#define SSPMODULES_SRC_ANLBOARD_DEVICEMANAGER_HPP_
10
11// #include "ftd2xx.h"
12// #include "USBDevice.h"
13#include "EthernetDevice.hpp"
14
15#include <cstdio>
16#include <cstring>
17#include <iomanip>
18#include <iostream>
19#include <map>
20#include <memory>
21#include <stdint.h>
22#include <string>
23#include <unistd.h>
24#include <vector>
25
26namespace dunedaq {
27namespace sspmodules {
28
30{
31
32public:
33 // Get reference to instance of DeviceManager singleton
34 static DeviceManager& Get();
35
36 // unsigned int GetNUSBDevices();
37
38 // Open a device and return a pointer containing a handle to it
39 Device* OpenDevice(unsigned int deviceId, bool slowControlOnly = false);
40
41 // Interrogate FTDI for list of devices. GetNUSBDevices and OpenDevice will call this
42 // if it has not yet been run, so it should not normally be necessary to call this directly.
43 void RefreshDevices();
44
45private:
47
48 DeviceManager(DeviceManager const&); // Don't implement
49
50 void operator=(DeviceManager const&); // Don't implement
51
52 // List of USB devices on FTDI link
53 // std::vector<USBDevice> fUSBDevices;
54
55 // Ethernet devices keyed by IP address
56 std::map<unsigned long, std::unique_ptr<EthernetDevice>> fEthernetDevices; // NOLINT(runtime/int)
57
59};
60
61} // namespace sspmodules
62} // namespace dunedaq
63
64#endif // SSPMODULES_SRC_ANLBOARD_DEVICEMANAGER_HPP_
void operator=(DeviceManager const &)
DeviceManager(DeviceManager const &)
Device * OpenDevice(unsigned int deviceId, bool slowControlOnly=false)
std::map< unsigned long, std::unique_ptr< EthernetDevice > > fEthernetDevices
The DUNE-DAQ namespace.