Main Page
Namespaces
Namespace List
Namespace Members
All
Functions
Variables
Classes
Class List
Class Members
All
Functions
Variables
Files
File List
File Members
All
Functions
src
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
{
43
class
FadecandyDriver
44
{
45
public
:
46
FadecandyDriver
();
47
~FadecandyDriver
();
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
fadecandy_driver::FadecandyDriver
Definition:
fadecandy_driver.h:43
fadecandy_driver::FadecandyDriver::findUsbDevice
libusb_device_descriptor findUsbDevice()
findUsbDevice Search the fadcandy device with particular vendor and product id
Definition:
fadecandy_driver.cpp:143
fadecandy_driver::FadecandyDriver::~FadecandyDriver
~FadecandyDriver()
Definition:
fadecandy_driver.cpp:56
fadecandy_driver::FadecandyDriver::connect
std::string connect()
connect Initialize the Fadecandy device
Definition:
fadecandy_driver.cpp:61
fadecandy_driver::FadecandyDriver::dev_handle_
libusb_device_handle * dev_handle_
dev_handle_ USB device handle
Definition:
fadecandy_driver.h:75
fadecandy_driver::FadecandyDriver::FadecandyDriver
FadecandyDriver()
Definition:
fadecandy_driver.cpp:47
fadecandy_driver::FadecandyDriver::setColors
void setColors(std::vector< std::vector< Color >> led_colors)
setColors Transfer the LED color stream to the driver
Definition:
fadecandy_driver.cpp:121
fadecandy_driver
Definition:
fadecandy_driver.cpp:39
fadecandy_driver::FadecandyDriver::isConnected
bool isConnected()
isConnected
Definition:
fadecandy_driver.cpp:116
util.h
fadecandy_driver::FadecandyDriver::context_
libusb_context * context_
context_ Lib USB Context
Definition:
fadecandy_driver.h:70
fadecandy_driver::FadecandyDriver::releaseInterface
void releaseInterface()
releaseInterface Release fadecandy device interface
Definition:
fadecandy_driver.cpp:169
fadecandy_driver
Author(s):
autogenerated on Wed Mar 2 2022 00:19:01