38#if (defined _WINDOWS || defined WIN32 || defined _MSC_VER) && !defined MINGW
39# if defined OPENZWAVE_MAKEDLL
40# define OPENZWAVE_EXPORT __declspec(dllexport)
41# elif defined OPENZWAVE_USEDLL
42# define OPENZWAVE_EXPORT __declspec(dllimport)
44# define OPENZWAVE_EXPORT
47# define OPENZWAVE_EXPORT_WARNINGS_OFF __pragma( warning(push) )\
48 __pragma( warning(disable: 4251) )
49# define OPENZWAVE_EXPORT_WARNINGS_ON __pragma( warning(pop) )
51# define OPENZWAVE_EXPORT
52# define OPENZWAVE_EXPORT_WARNINGS_OFF
53# define OPENZWAVE_EXPORT_WARNINGS_ON
72typedef signed __int64 int64;
73typedef unsigned __int64 uint64;
77typedef signed long long int64;
78typedef unsigned long long uint64;
93static inline uint16_t version_major(
struct ozwversion v) {
94 return (
v._v & 0xFFFF0000) >> 16;
102static inline uint16_t version_minor(
const struct ozwversion &
v) {
103 return v._v & 0xFFFF;
112static inline struct ozwversion version(uint16_t major, uint16_t minor)
115 v._v = (uint32_t)(major << 16) | (uint32_t)minor;
134 return (a.
_v == b.
_v) ? 0 : (a.
_v > b.
_v) ? 1 : - 1;
155#define snprintf sprintf_s
156#define strcasecmp _stricmp
157#define sscanf sscanf_s
165#define sprintf_s snprintf
178#define MAX_MAX_TRIES 7
179#define ACK_TIMEOUT 1000
180#define BYTE_TIMEOUT 150
181#define RETRY_TIMEOUT 40000
188#define NUM_NODE_BITFIELD_BYTES 29
193#define ZW_CLOCK_SET 0x30
195#define TRANSMIT_OPTION_ACK 0x01
196#define TRANSMIT_OPTION_LOW_POWER 0x02
197#define TRANSMIT_OPTION_AUTO_ROUTE 0x04
198#define TRANSMIT_OPTION_NO_ROUTE 0x10
199#define TRANSMIT_OPTION_EXPLORE 0x20
201#define TRANSMIT_COMPLETE_OK 0x00
202#define TRANSMIT_COMPLETE_NO_ACK 0x01
203#define TRANSMIT_COMPLETE_FAIL 0x02
204#define TRANSMIT_COMPLETE_NOT_IDLE 0x03
205#define TRANSMIT_COMPLETE_NOROUTE 0x04
207#define RECEIVE_STATUS_ROUTED_BUSY 0x01
208#define RECEIVE_STATUS_TYPE_BROAD 0x04
210#define FUNC_ID_SERIAL_API_GET_INIT_DATA 0x02
211#define FUNC_ID_SERIAL_API_APPL_NODE_INFORMATION 0x03
212#define FUNC_ID_APPLICATION_COMMAND_HANDLER 0x04
213#define FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES 0x05
214#define FUNC_ID_SERIAL_API_SET_TIMEOUTS 0x06
215#define FUNC_ID_SERIAL_API_GET_CAPABILITIES 0x07
216#define FUNC_ID_SERIAL_API_SOFT_RESET 0x08
218#define FUNC_ID_ZW_SEND_NODE_INFORMATION 0x12
219#define FUNC_ID_ZW_SEND_DATA 0x13
220#define FUNC_ID_ZW_GET_VERSION 0x15
221#define FUNC_ID_ZW_R_F_POWER_LEVEL_SET 0x17
222#define FUNC_ID_ZW_GET_RANDOM 0x1c
223#define FUNC_ID_ZW_MEMORY_GET_ID 0x20
224#define FUNC_ID_MEMORY_GET_BYTE 0x21
225#define FUNC_ID_ZW_READ_MEMORY 0x23
227#define FUNC_ID_ZW_SET_LEARN_NODE_STATE 0x40
228#define FUNC_ID_ZW_GET_NODE_PROTOCOL_INFO 0x41
229#define FUNC_ID_ZW_SET_DEFAULT 0x42
230#define FUNC_ID_ZW_NEW_CONTROLLER 0x43
231#define FUNC_ID_ZW_REPLICATION_COMMAND_COMPLETE 0x44
232#define FUNC_ID_ZW_REPLICATION_SEND_DATA 0x45
233#define FUNC_ID_ZW_ASSIGN_RETURN_ROUTE 0x46
234#define FUNC_ID_ZW_DELETE_RETURN_ROUTE 0x47
235#define FUNC_ID_ZW_REQUEST_NODE_NEIGHBOR_UPDATE 0x48
236#define FUNC_ID_ZW_APPLICATION_UPDATE 0x49
237#define FUNC_ID_ZW_ADD_NODE_TO_NETWORK 0x4a
238#define FUNC_ID_ZW_REMOVE_NODE_FROM_NETWORK 0x4b
239#define FUNC_ID_ZW_CREATE_NEW_PRIMARY 0x4c
240#define FUNC_ID_ZW_CONTROLLER_CHANGE 0x4d
241#define FUNC_ID_ZW_SET_LEARN_MODE 0x50
242#define FUNC_ID_ZW_ASSIGN_SUC_RETURN_ROUTE 0x51
243#define FUNC_ID_ZW_ENABLE_SUC 0x52
244#define FUNC_ID_ZW_REQUEST_NETWORK_UPDATE 0x53
245#define FUNC_ID_ZW_SET_SUC_NODE_ID 0x54
246#define FUNC_ID_ZW_DELETE_SUC_RETURN_ROUTE 0x55
247#define FUNC_ID_ZW_GET_SUC_NODE_ID 0x56
248#define FUNC_ID_ZW_REQUEST_NODE_NEIGHBOR_UPDATE_OPTIONS 0x5a
249#define FUNC_ID_ZW_REQUEST_NODE_INFO 0x60
250#define FUNC_ID_ZW_REMOVE_FAILED_NODE_ID 0x61
251#define FUNC_ID_ZW_IS_FAILED_NODE_ID 0x62
252#define FUNC_ID_ZW_REPLACE_FAILED_NODE 0x63
253#define FUNC_ID_ZW_GET_ROUTING_INFO 0x80
254#define FUNC_ID_SERIAL_API_SLAVE_NODE_INFO 0xA0
255#define FUNC_ID_APPLICATION_SLAVE_COMMAND_HANDLER 0xA1
256#define FUNC_ID_ZW_SEND_SLAVE_NODE_INFO 0xA2
257#define FUNC_ID_ZW_SEND_SLAVE_DATA 0xA3
258#define FUNC_ID_ZW_SET_SLAVE_LEARN_MODE 0xA4
259#define FUNC_ID_ZW_GET_VIRTUAL_NODES 0xA5
260#define FUNC_ID_ZW_IS_VIRTUAL_NODE 0xA6
261#define FUNC_ID_ZW_SET_PROMISCUOUS_MODE 0xD0
262#define FUNC_ID_PROMISCUOUS_APPLICATION_COMMAND_HANDLER 0xD1
264#define ADD_NODE_ANY 0x01
265#define ADD_NODE_CONTROLLER 0x02
266#define ADD_NODE_SLAVE 0x03
267#define ADD_NODE_EXISTING 0x04
268#define ADD_NODE_STOP 0x05
269#define ADD_NODE_STOP_FAILED 0x06
271#define ADD_NODE_STATUS_LEARN_READY 0x01
272#define ADD_NODE_STATUS_NODE_FOUND 0x02
273#define ADD_NODE_STATUS_ADDING_SLAVE 0x03
274#define ADD_NODE_STATUS_ADDING_CONTROLLER 0x04
275#define ADD_NODE_STATUS_PROTOCOL_DONE 0x05
276#define ADD_NODE_STATUS_DONE 0x06
277#define ADD_NODE_STATUS_FAILED 0x07
279#define REMOVE_NODE_ANY 0x01
280#define REMOVE_NODE_CONTROLLER 0x02
281#define REMOVE_NODE_SLAVE 0x03
282#define REMOVE_NODE_STOP 0x05
284#define REMOVE_NODE_STATUS_LEARN_READY 0x01
285#define REMOVE_NODE_STATUS_NODE_FOUND 0x02
286#define REMOVE_NODE_STATUS_REMOVING_SLAVE 0x03
287#define REMOVE_NODE_STATUS_REMOVING_CONTROLLER 0x04
288#define REMOVE_NODE_STATUS_DONE 0x06
289#define REMOVE_NODE_STATUS_FAILED 0x07
291#define CREATE_PRIMARY_START 0x02
292#define CREATE_PRIMARY_STOP 0x05
293#define CREATE_PRIMARY_STOP_FAILED 0x06
295#define CONTROLLER_CHANGE_START 0x02
296#define CONTROLLER_CHANGE_STOP 0x05
297#define CONTROLLER_CHANGE_STOP_FAILED 0x06
299#define LEARN_MODE_STARTED 0x01
300#define LEARN_MODE_DONE 0x06
301#define LEARN_MODE_FAILED 0x07
302#define LEARN_MODE_DELETED 0x80
304#define REQUEST_NEIGHBOR_UPDATE_STARTED 0x21
305#define REQUEST_NEIGHBOR_UPDATE_DONE 0x22
306#define REQUEST_NEIGHBOR_UPDATE_FAILED 0x23
308#define FAILED_NODE_OK 0x00
309#define FAILED_NODE_REMOVED 0x01
310#define FAILED_NODE_NOT_REMOVED 0x02
312#define FAILED_NODE_REPLACE_WAITING 0x03
313#define FAILED_NODE_REPLACE_DONE 0x04
314#define FAILED_NODE_REPLACE_FAILED 0x05
316#define FAILED_NODE_REMOVE_STARTED 0x00
317#define FAILED_NODE_NOT_PRIMARY_CONTROLLER 0x02
318#define FAILED_NODE_NO_CALLBACK_FUNCTION 0x04
319#define FAILED_NODE_NOT_FOUND 0x08
320#define FAILED_NODE_REMOVE_PROCESS_BUSY 0x10
321#define FAILED_NODE_REMOVE_FAIL 0x20
323#define SUC_UPDATE_DONE 0x00
324#define SUC_UPDATE_ABORT 0x01
325#define SUC_UPDATE_WAIT 0x02
326#define SUC_UPDATE_DISABLED 0x03
327#define SUC_UPDATE_OVERFLOW 0x04
329#define SUC_FUNC_BASIC_SUC 0x00
330#define SUC_FUNC_NODEID_SERVER 0x01
332#define UPDATE_STATE_NODE_INFO_RECEIVED 0x84
333#define UPDATE_STATE_NODE_INFO_REQ_DONE 0x82
334#define UPDATE_STATE_NODE_INFO_REQ_FAILED 0x81
335#define UPDATE_STATE_ROUTING_PENDING 0x80
336#define UPDATE_STATE_NEW_ID_ASSIGNED 0x40
337#define UPDATE_STATE_DELETE_DONE 0x20
338#define UPDATE_STATE_SUC_ID 0x10
340#define APPLICATION_NODEINFO_LISTENING 0x01
341#define APPLICATION_NODEINFO_OPTIONAL_FUNCTIONALITY 0x02
343#define SLAVE_ASSIGN_COMPLETE 0x00
344#define SLAVE_ASSIGN_NODEID_DONE 0x01
345#define SLAVE_ASSIGN_RANGE_INFO_UPDATE 0x02
347#define SLAVE_LEARN_MODE_DISABLE 0x00
348#define SLAVE_LEARN_MODE_ENABLE 0x01
349#define SLAVE_LEARN_MODE_ADD 0x02
350#define SLAVE_LEARN_MODE_REMOVE 0x03
352#define OPTION_HIGH_POWER 0x80
355#define BASIC_SET 0x01
356#define BASIC_REPORT 0x03
358#define COMMAND_CLASS_BASIC 0x20
359#define COMMAND_CLASS_CONTROLLER_REPLICATION 0x21
360#define COMMAND_CLASS_APPLICATION_STATUS 0x22
361#define COMMAND_CLASS_HAIL 0x82
unsigned short uint16
Definition: Defs.h:66
unsigned int uint32
Definition: Defs.h:69
signed char int8
Definition: Defs.h:62
double float64
Definition: Defs.h:82
signed short int16
Definition: Defs.h:65
signed int int32
Definition: Defs.h:68
struct ozwversion ozwversion
float float32
Definition: Defs.h:81
unsigned char uint8
Definition: Defs.h:63
#define v(n, i)
Definition: aeskey.c:224
Definition: Bitfield.h:35
uint32_t _v
Definition: Defs.h:85