fadecandy_driver.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 Eurotec, Netherlands
3  * All rights reserved.
4  *
5  * Author: Jad Haj Mustafa
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * 3. Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #include <libusb-1.0/libusb.h>
36 #include <string>
37 #include <vector>
38 
39 #include "./util.h"
40 
41 namespace fadecandy_driver
42 {
44 {
45 public:
48 
53  std::string connect();
54 
59  bool isConnected();
60 
64  void setColors(std::vector<std::vector<Color>> led_colors);
65 
66 private:
70  libusb_context* context_ = NULL;
71 
75  libusb_device_handle* dev_handle_ = NULL;
76 
81  libusb_device_descriptor findUsbDevice();
82 
86  void releaseInterface();
87 };
88 } // namespace fadecandy_driver
void releaseInterface()
releaseInterface Release fadecandy device interface
void setColors(std::vector< std::vector< Color >> led_colors)
setColors Transfer the LED color stream to the driver
libusb_device_handle * dev_handle_
dev_handle_ USB device handle
libusb_context * context_
context_ Lib USB Context
std::string connect()
connect Initialize the Fadecandy device
libusb_device_descriptor findUsbDevice()
findUsbDevice Search the fadcandy device with particular vendor and product id


fadecandy_driver
Author(s):
autogenerated on Mon Feb 28 2022 22:18:46