WPILibC++  unspecified
UsbUtil.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #ifndef CSCORE_USBUTIL_H_
9 #define CSCORE_USBUTIL_H_
10 
11 #include <stdint.h>
12 
13 #include <wpi/SmallVector.h>
14 #include <wpi/StringRef.h>
15 
16 namespace cs {
17 
18 #ifdef __linux__
19 
20 wpi::StringRef GetUsbNameFromId(int vendor, int product,
22 
23 int CheckedIoctl(int fd, unsigned long req, void* data, // NOLINT(runtime/int)
24  const char* name, const char* file, int line, bool quiet);
25 
26 #define DoIoctl(fd, req, data) \
27  CheckedIoctl(fd, req, data, #req, __FILE__, __LINE__, false)
28 #define TryIoctl(fd, req, data) \
29  CheckedIoctl(fd, req, data, #req, __FILE__, __LINE__, true)
30 
31 #endif // __linux__
32 
33 } // namespace cs
34 
35 #endif // CSCORE_USBUTIL_H_
Definition: CvSourceImpl.h:19
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49