AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
canal_a.h
1/*
2MIT License
3
4Copyright (c) 2005-2023 Gediminas Simanskis, Rusoku technologijos UAB ([email protected])
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in all
14copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22SOFTWARE.
23*/
24
25// clang-format off
27
28#ifndef ___CANAL_A_H___
29#define ___CANAL_A_H___
30
31
32#ifndef EXPORT
33#define EXPORT
34#endif
35
36
37
38#ifdef WIN32
39#ifndef WINAPI
40#define WINAPI __stdcall
41#endif
42#else
43
44#endif
45
46/* FILTER req type */
47typedef enum {
48 FILTER_ACCEPT_ALL = 0,
49 FILTER_REJECT_ALL,
50 FILTER_VALUE,
51}Filter_Type_TypeDef;
52
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
64#ifdef WIN32
65int WINAPI EXPORT CanalSetFilter11bit( long handle, Filter_Type_TypeDef type, unsigned long list, unsigned long mask );
66#else
67int CanalSetFilter11bit( long handle, Filter_Type_TypeDef type, unsigned long id, unsigned long mask );
68#endif
69
76#ifdef WIN32
77int WINAPI EXPORT CanalSetFilter29bit( long handle, Filter_Type_TypeDef type, unsigned long list, unsigned long mask );
78#else
79int CanalSetFilter29bit( long handle, Filter_Type_TypeDef type, unsigned long id, unsigned long mask );
80#endif
81
88#ifdef WIN32
89int WINAPI EXPORT CanalGetBootloaderVersion(long handle, unsigned long *bootloader_version);
90#else
91int CanalGetBootloaderVersion(long handle, unsigned long *bootloader_version);
92#endif
93
94
95#ifdef WIN32
96int WINAPI EXPORT CanalGetHardwareVersion(long handle, unsigned long *hardware_version);
97#else
98int CanalGetHardwareVersion(long handle, unsigned long *hardware_version);
99#endif
100
101
102#ifdef WIN32
103int WINAPI EXPORT CanalGetFirmwareVersion(long handle, unsigned long *firmware_version);
104#else
105int CanalGetFirmwareVersion(long handle, unsigned long *firmware_version);
106#endif
107
108#ifdef WIN32
109int WINAPI EXPORT CanalGetSerialNumber(long handle, unsigned long *serial);
110#else
111int CanalGetSerialNumber(long handle, unsigned long *serial);
112#endif
113
114#ifdef WIN32
115int WINAPI EXPORT CanalGetVidPid(long handle, unsigned long *vidpid);
116#else
117int CanalGetVidPid(long handle, unsigned long *vidpid);
118#endif
119
120#ifdef WIN32
121int WINAPI EXPORT CanalGetDeviceId(long handle, unsigned long *deviceid);
122#else
123int CanalGetDeviceId(long handle, unsigned long *deviceid);
124#endif
125
126#ifdef WIN32
127int WINAPI EXPORT CanalGetVendor(long handle, unsigned int size, char *vendor);
128#else
129int CanalGetVendor(long handle, unsigned long *bootloader_version);
130#endif
131
132#ifdef WIN32
133int WINAPI EXPORT CanalInterfaceStart(long handle);
134#else
135int CanalInterfaceStart(long handle);
136#endif
137
138#ifdef WIN32
139int WINAPI EXPORT CanalInterfaceStop(long handle);
140#else
141int CanalInterfaceStop(long handle);
142#endif
143
144#ifdef __cplusplus
145}
146#endif
147
148#endif //___CANAL_A_H___
149
150// clang-format on