GCC Code Coverage Report


Directory: ./
File: channeloutput/USBDMX.h
Date: 2026-10-29 08:11:58
Exec Total Coverage
Lines: 4 6 66.7%
Functions: 1 1 100.0%
Branches: 3 10 30.0%

Line Branch Exec Source
1 #pragma once
2 /*
3 * This file is part of the Falcon Player (FPP) and is Copyright (C)
4 * 2013-2022 by the Falcon Player Developers.
5 *
6 * The Falcon Player (FPP) is free software, and is covered under
7 * multiple Open Source licenses. Please see the included 'LICENSES'
8 * file for descriptions of what files are covered by each license.
9 *
10 * This source file is covered under the GPL v2 as described in the
11 * included LICENSE.GPL file.
12 */
13
14 #include <string>
15 #include "fpp-json-fwd.h"
16
17 #include "SerialChannelOutput.h"
18 #include "ThreadedChannelOutput.h"
19
20 class USBDMXOutput : public ThreadedChannelOutput, public SerialChannelOutput {
21 public:
22 USBDMXOutput(unsigned int startChannel, unsigned int channelCount);
23 virtual ~USBDMXOutput();
24
25 virtual int Init(Json::Value config) override;
26
27 virtual int Close(void) override;
28
29 virtual int RawSendData(unsigned char* channelData) override;
30 virtual void WaitTimedOut() override;
31
32 virtual void DumpConfig(void) override;
33
34 virtual void GetRequiredChannelRanges(const std::function<void(int, int)>& addRange) override;
35
36 1 virtual std::string GetOutputType() const override {
37
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 if (m_dongleType == DMX_DVC_PRO) {
38 ✗ return "USB-DMX-Pro";
39
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 } else if (m_dongleType == DMX_DVC_OPEN) {
40
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
2 return "USB-DMX-Open";
41 }
42 ✗ return "USB-DMX-Unknown";
43 }
44
45 private:
46 enum DongleType {
47 DMX_DVC_UNKNOWN,
48 DMX_DVC_PRO,
49 DMX_DVC_OPEN
50 };
51
52 DongleType m_dongleType;
53
54 char m_outputData[513 + 6];
55 int m_dataOffset;
56 int m_dataLen;
57 };
58