This repository has been archived by the owner on Feb 26, 2022. It is now read-only.
forked from fx5/usbdmx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
usbdmx.h
80 lines (64 loc) · 2.55 KB
/
usbdmx.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef USBDMX_H_
#define USBDMX_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define DWORD uint32_t
#ifdef WIN32
#define USB_DMX_DLL __declspec(dllexport) __stdcall
#define USB_DMX_CALLBACK __stdcall
#else
#define USB_DMX_DLL
#define USB_DMX_CALLBACK
#endif
// types for library functions
typedef unsigned char TDMXArray[512];
typedef char TSERIAL[16];
typedef TSERIAL TSERIALLIST[32];
typedef void USB_DMX_CALLBACK (THOSTDEVICECHANGEPROC) (void);
typedef void USB_DMX_CALLBACK (THOSTINPUTCHANGEPROCBLOCK) (unsigned char blocknumber);
// define library functions
USB_DMX_DLL void GetAllConnectedInterfaces(TSERIALLIST* SerialList);
USB_DMX_DLL void GetAllOpenedInterfaces(TSERIALLIST* SerialList);
USB_DMX_DLL DWORD OpenLink(TSERIAL Serial, TDMXArray *DMXOutArray, TDMXArray *DMXInArray);
USB_DMX_DLL DWORD CloseLink (TSERIAL Serial);
USB_DMX_DLL DWORD CloseAllLinks (void);
USB_DMX_DLL DWORD RegisterInterfaceChangeNotification (THOSTDEVICECHANGEPROC Proc);
USB_DMX_DLL DWORD UnregisterInterfaceChangeNotification (void);
USB_DMX_DLL DWORD RegisterInputChangeNotification (THOSTDEVICECHANGEPROC Proc);
USB_DMX_DLL DWORD UnregisterInputChangeNotification (void);
USB_DMX_DLL DWORD SetInterfaceMode (TSERIAL Serial, unsigned char Mode);
// Modes:
// 0: Do nothing - Standby
// 1: DMX In -> DMX Out
// 2: PC Out -> DMX Out
// 3: DMX In + PC Out -> DMX Out
// 4: DMX In -> PC In
// 5: DMX In -> DMX Out & DMX In -> PC In
// 6: PC Out -> DMX Out & DMX In -> PC In
// 7: DMX In + PC Out -> DMX Out & DMX In -> PC In
USB_DMX_DLL DWORD GetDeviceVersion(TSERIAL Serial);
USB_DMX_DLL DWORD SetInterfaceAdvTxConfig(
TSERIAL Serial, unsigned char Control, uint16_t Breaktime, uint16_t Marktime,
uint16_t Interbytetime, uint16_t Interframetime, uint16_t Channelcount, uint16_t Startbyte
);
USB_DMX_DLL DWORD StoreInterfaceAdvTxConfig(TSERIAL Serial);
USB_DMX_DLL DWORD RegisterInputChangeBlockNotification(THOSTINPUTCHANGEPROCBLOCK Proc);
USB_DMX_DLL DWORD UnregisterInputChangeBlockNotification(void);
/// And the Functions from usbdmxsi.USB_DMX_DLL also
USB_DMX_DLL DWORD OpenInterface(TDMXArray * DMXOutArray, TDMXArray * DMXInArray, unsigned char Mode);
// Modes:
// 0: Do nothing - Standby
// 1: DMX In -> DMX Out
// 2: PC Out -> DMX Out
// 3: DMX In + PC Out -> DMX Out
// 4: DMX In -> PC In
// 5: DMX In -> DMX Out & DMX In -> PC In
// 6: PC Out -> DMX Out & DMX In -> PC In
// 7: DMX In + PC Out -> DMX Out & DMX In -> PC In
USB_DMX_DLL DWORD CloseInterface(void);
#ifdef __cplusplus
}
#endif
#endif // defined USBDMX_H_