Skip to content

Commit 5e0ec35

Browse files
committed
Updated OZW headers
1 parent b3dad85 commit 5e0ec35

File tree

10 files changed

+251
-15
lines changed

10 files changed

+251
-15
lines changed

hardware/openzwave/Defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ namespace OpenZWave
192192
#define snprintf sprintf_s
193193
#define strcasecmp _stricmp
194194
#define sscanf sscanf_s
195-
#define strncpy strncpy_s
195+
#define strncpy(x, y, z) strncpy_s(x, sizeof(x), y, sizeof(x)-1)
196196
#define strncat strncat_s
197197

198198

hardware/openzwave/Driver.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,12 @@ namespace OpenZWave
269269
//void ReleaseNodes();
270270

271271
ControllerInterface m_controllerInterfaceType; // Specifies the controller's hardware interface
272-
OPENZWAVE_EXPORT_WARNINGS_OFF
273272
string m_controllerPath; // name or path used to open the controller hardware.
274-
OPENZWAVE_EXPORT_WARNINGS_ON
275273
Controller* m_controller; // Handles communications with the controller hardware.
276274
uint32 m_homeId; // Home ID of the Z-Wave controller. Not valid until the DriverReady notification has been received.
277-
OPENZWAVE_EXPORT_WARNINGS_OFF
275+
278276
string m_libraryVersion; // Version of the Z-Wave Library used by the controller.
279277
string m_libraryTypeName; // Name describing the library type.
280-
OPENZWAVE_EXPORT_WARNINGS_ON
281278
uint8 m_libraryType; // Type of library used by the controller.
282279

283280
uint8 m_serialAPIVersion[2];

hardware/openzwave/Msg.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,8 @@ namespace OpenZWave
172172

173173

174174
void MultiEncap(); // Encapsulate the data inside a MultiInstance/Multicommand message
175-
OPENZWAVE_EXPORT_WARNINGS_OFF
175+
176176
string m_logText;
177-
OPENZWAVE_EXPORT_WARNINGS_ON
178177
bool m_bFinal;
179178
bool m_bCallbackRequired;
180179

hardware/openzwave/Notification.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ namespace OpenZWave
129129
enum UserAlertNotification
130130
{
131131
Alert_None, /**< No Alert Currently Present */
132-
Alert_ConfigOutOfDate, /**< One of the Config Files is out of date. Use GetNodeId to determine which node is affected. */
132+
Alert_ConfigOutOfDate, /**< One of the Config Files is out of date. Use GetNodeId to determine which node is effected. */
133133
Alert_MFSOutOfDate, /**< the manufacturer_specific.xml file is out of date. */
134134
Alert_ConfigFileDownloadFailed, /**< A Config File failed to download */
135135
Alert_DNSError, /**< A error occurred performing a DNS Lookup */
136-
Alert_NodeReloadReqired, /**< A new Config file has been discovered for this node, and its pending a Reload to Take Effect */
136+
Alert_NodeReloadRequired, /**< A new Config file has been discovered for this node, and its pending a Reload to Take affect */
137137
Alert_UnsupportedController, /**< The Controller is not running a Firmware Library we support */
138138
Alert_ApplicationStatus_Retry, /**< Application Status CC returned a Retry Later Message */
139-
Alert_ApplicationStatus_Queued, /**< Command Has been Queued for execution later */
139+
Alert_ApplicationStatus_Queued, /**< Command Has been Queued for later execution */
140140
Alert_ApplicationStatus_Rejected, /**< Command has been rejected */
141141
};
142142

@@ -256,9 +256,7 @@ namespace OpenZWave
256256
uint8 m_event;
257257
uint8 m_command;
258258
UserAlertNotification m_useralerttype;
259-
OPENZWAVE_EXPORT_WARNINGS_OFF
260259
string m_comport;
261-
OPENZWAVE_EXPORT_WARNINGS_ON
262260
};
263261

264262
} //namespace OpenZWave

hardware/openzwave/Options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,11 @@ namespace OpenZWave
241241

242242
OPENZWAVE_EXPORT_WARNINGS_OFF
243243
map<string,Option*> m_options; // Map of option names to values.
244+
OPENZWAVE_EXPORT_WARNINGS_ON
244245
string m_xml; // Path to XML options file.
245246
string m_commandLine; // String containing command line options.
246247
string m_SystemPath;
247248
string m_LocalPath;
248-
OPENZWAVE_EXPORT_WARNINGS_ON
249249
bool m_locked; // If true, the options are final and AddOption can no longer be called.
250250
static Options* s_instance;
251251
};

hardware/openzwave/Utils.h

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,44 @@ namespace OpenZWave
6565
void split (std::vector<std::string>& lst, const std::string& input, const std::string& separators, bool remove_empty = true);
6666

6767
/**
68-
* Trim Whitespace from the start and end of a string.
68+
* remove all Whitespace from of a string.
6969
* \param s the string to trim
7070
* \return the trimmed string
7171
*/
72-
std::string &trim ( std::string &s );
72+
std::string &removewhitespace ( std::string &s );
73+
74+
/**
75+
* @brief Left Trim
76+
*
77+
* Trims whitespace from the left end of the provided std::string
78+
*
79+
* @param[out] s The std::string to trim
80+
*
81+
* @return The modified std::string&
82+
*/
83+
std::string& ltrim(std::string& s);
84+
85+
/**
86+
* @brief Right Trim
87+
*
88+
* Trims whitespace from the right end of the provided std::string
89+
*
90+
* @param[out] s The std::string to trim
91+
*
92+
* @return The modified std::string&
93+
*/
94+
std::string& rtrim(std::string& s);
95+
96+
/**
97+
* @brief Trim
98+
*
99+
* Trims whitespace from both ends of the provided std::string
100+
*
101+
* @param[out] s The std::string to trim
102+
*
103+
* @return The modified std::string&
104+
*/
105+
std::string& trim(std::string& s);
73106

74107

75108
void PrintHex(std::string prefix, uint8_t const *data, uint32 const length);

hardware/openzwave/ValueIDIndexes.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//-----------------------------------------------------------------------------
2+
//
3+
// ValueIDIndexes.h
4+
//
5+
// List of all Possible ValueID Indexes in OZW
6+
//
7+
// Copyright (c) 2010 Mal Lansell <openzwave@lansell.org>
8+
//
9+
// SOFTWARE NOTICE AND LICENSE
10+
//
11+
// This file is part of OpenZWave.
12+
//
13+
// OpenZWave is free software: you can redistribute it and/or modify
14+
// it under the terms of the GNU Lesser General Public License as published
15+
// by the Free Software Foundation, either version 3 of the License,
16+
// or (at your option) any later version.
17+
//
18+
// OpenZWave is distributed in the hope that it will be useful,
19+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
20+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+
// GNU Lesser General Public License for more details.
22+
//
23+
// You should have received a copy of the GNU Lesser General Public License
24+
// along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
25+
//
26+
//-----------------------------------------------------------------------------
27+
28+
29+
30+
/* This file is includes the pre-processed ValueIDIndexesDefines.h to avoid problems
31+
* with MSVC not supporting enough arguments with Macro's.
32+
* If you are adding a ValueID, you should add its index ENUM to ValuIDIndexDefines.def and the run
33+
* 'make updateIndexDefines' to regenerate the the ValueIDIndexDefines.h file
34+
*/
35+
36+
#include <cstring>
37+
38+
#ifndef _ValueIDIndexes_H
39+
#define _ValueIDIndexes_H
40+
41+
#include "ValueIDIndexesDefines.h"
42+
43+
#endif

hardware/openzwave/ValueIDIndexesDefines.h

Lines changed: 160 additions & 0 deletions
Large diffs are not rendered by default.

hardware/openzwave/platform/HidController.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#include "platform/Controller.h"
3434

3535

36+
#ifdef USE_HID
37+
3638
struct hid_device_;
3739

3840
typedef struct hid_device_ hid_device;
@@ -151,5 +153,7 @@ namespace OpenZWave
151153

152154
} // namespace OpenZWave
153155

156+
#endif
157+
154158
#endif //_HidController_H
155159

hardware/openzwave/value_classes/ValueID.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
#include <string>
3232
#include <assert.h>
33+
34+
#include "ValueIDIndexes.h"
3335
#include "Defs.h"
3436

3537
class TiXmlElement;

0 commit comments

Comments
 (0)