forked from open-hpi/openhpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.windows
152 lines (118 loc) · 4.78 KB
/
README.windows
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
========================================================================
This package provides windows version of
- Base HPI library (libopenhpi.dll)
- OpenHPI utils library (libopenhpiutils.dll)
- OpenHPI marshal library (libopenhpimarshal.dll)
- OpenHPI transport library (libopenhpitransport.dll)
- OpenHPI clients:
-- hpialarms.exe
-- hpidomain.exe
-- hpiel.exe
-- hpievents.exe
-- hpifan.exe
-- hpigensimdata.exe
-- hpiinv.exe
-- hpionIBMblade.exe
-- hpipower.exe
-- hpireset.exe
-- hpisensor.exe
-- hpisettime.exe
-- hpithres.exe
-- hpitop.exe
-- hpitree.exe
-- hpiwdt.exe
-- hpixml.exe
-- ohdomainlist.exe
-- ohhandler.exe
-- ohparam.exe
- OpenHPI daemon as a console Windows application (openhpid.exe)
-- Slave plug-in (libslave.dll)
-- Test Agent plug-in (libtest_agent.dll)
The package also provides necessary glib2 libraries:
- libglib-2.0-0.dll
- libgthread-2.0-0.dll
- libgmodule-2.0-0.dll
NB: glib2 libraries were obtained in binary form from
http://www.gtk.org/download-windows.html and were included
without any change.
NB: glib2 is distributed under LGPL2 license.
The package can include additional auxiliary libraries.
========================================================================
Dependencies:
The only dependence (save for mingw compiler) is glib2.
Windows version can be obtained at http://www.gtk.org/download-windows.html
========================================================================
Current windows build system supports only mingw compiler.
http://www.mingw.org/
However the built libraries can be use as ordinary windows DLL
in projects with any compiler.
========================================================================
Build instructions:
- Get mingw (cross or native).
- Get archive with glib2 for windows and unpack it somewhere.
- Enter OpenHPI source tree root directory.
- Modify Makefile.mingw32.def:
-- ARCH in order to point architecture for produced binaries
-- TOOLCHAIN_PATH in order that CC, CXX, AS and RC point to correct files.
-- GLIB_DIR: in order that GLIB_INCLUDES and GLIB_LIBS
point to valid directories with glib headers and libraries.
- Run "make -f Makefile.mingw32".
- Run "make -f Makefile.mingw32 out".
- The openhpi-${VERSION}-win32-${ARCH} sub-directory will contain all produced stuff.
- For gcc4-based compiler (i.e. mingw-w64.sourceforge.net ) you need to copy more libs:
-- libgcc_s_*.dll
-- libstdc++-*.dll
- Optional step - strip produced exe and dll files.
========================================================================
Client Usage instructions:
There are two ways:
Way 1) prepare openhpiclient.conf and set env. var. OPENHPICLIENT_CONF
to its path
Way 2) set env. var. OPENHPI_DAEMON_HOST to OpenHPI daemon address.
========================================================================
Library Usage instructions:
Header file SaHpi.h contains declarations on provided HPI functions.
Header file oHpi.h contains declarations on provided OpenHPI extension functions.
Make sure to use the oHpi.h and SaHpi.h files from openhpi-3.3.0-win32-x86 or
openhpi-3.3.0-win32-amd64 directory, not the ones from trunk/include directory.
The functions are in libopenhpi.dll.
Define "SAHPI_API" macro as "__declspec(dllimport)".
For mingw compiler it can be just linked.
For MSVC:
- There is def file libopenhpi.def
- With lib tool you can create import library
- Command example "lib /machine:i386 /def:libopenhpi.def"
- Point produced import library in Project settings
For application running and distribution::
- copy necessary libraries to your application dir.
And see Client Usage instructions about configuring OpenHPI daemon address
to connect.
========================================================================
Library Known Issues:
===================================================
Seems mingw has its own copy of environment variables.
So the code:
_putenv("OPENHPI_DAEMON_HOST=...");
rv = saHpiSessionOpen(...)
does not work in MSVC as expected.
But setting any variable before running executable works!
===================================================
Seems client applications do not close sockets.
The sockets remain in TIME_WAIT state.
It can exhaust system resources.
========================================================================
Daemon Usage instructions:
Only Slave plug-in and Test agent plug-in are now ported under Windows.
- prepare openhpi.conf
- openhpid.exe -v -c "path to openhpi.conf"
As an optional step you can do
- set OPENHPI_UID_MAP="path to uid map file"
before running openhpid.exe.
The uid map file will be used for persistent
resource id <-> entity path mapping.
NB: -v is optional flag for verbose messages.
========================================================================
Troubleshouting:
Mailing list: [email protected]
or
IRC channel #openhpi on FreeNode.