52 class ControllerReplication;
84 ControllerInterface_Unknown = 0,
86 ControllerInterface_Hid
110 static void DriverThreadEntryPoint(
Event* _exitEvent,
void* _context );
129 void DriverThreadProc(
Event* _exitEvent );
143 bool Init(
uint32 _attempts );
149 void RemoveQueues(
uint8 const _nodeId );
155 bool m_awakeNodesQueried;
156 bool m_allNodesQueried;
157 bool m_notifytransactions;
164 void RequestConfig();
175 ControllerCaps_Secondary = 0x01,
176 ControllerCaps_OnOtherNetwork = 0x02,
177 ControllerCaps_SIS = 0x04,
178 ControllerCaps_RealPrimary = 0x08,
179 ControllerCaps_SUC = 0x10
185 InitCaps_Slave = 0x01,
186 InitCaps_TimerSupport = 0x02,
187 InitCaps_Secondary = 0x04,
191 bool IsPrimaryController()
const{
return ((m_initCaps & InitCaps_Secondary) == 0); }
192 bool IsStaticUpdateController()
const{
return ((m_initCaps & InitCaps_SUC) != 0); }
193 bool IsBridgeController()
const{
return (m_libraryType == 7); }
194 bool IsInclusionController()
const{
return ((m_controllerCaps & ControllerCaps_SIS) != 0); }
197 uint32 GetHomeId()
const{
return m_homeId; }
198 uint8 GetControllerNodeId()
const{
return m_Controller_nodeId; }
199 uint8 GetSUCNodeId()
const{
return m_SUCNodeId; }
200 uint16 GetManufacturerId()
const{
return m_manufacturerId; }
201 uint16 GetProductType()
const{
return m_productType; }
202 uint16 GetProductId()
const{
return m_productId; }
203 string GetControllerPath()
const{
return m_controllerPath; }
205 string GetLibraryVersion()
const{
return m_libraryVersion; }
206 string GetLibraryTypeName()
const{
return m_libraryTypeName; }
207 int32 GetSendQueueCount()
const 210 for(
int32 i=0; i<MsgQueue_Count; ++i )
212 count += (
int32) (m_msgQueue[i].size());
247 string m_controllerPath;
251 string m_libraryVersion;
252 string m_libraryTypeName;
255 uint8 m_serialAPIVersion[2];
263 uint8 m_controllerCaps;
264 uint8 m_Controller_nodeId;
270 uint8 m_transmitOptions;
277 void ProcessMsg(
uint8* _data );
279 void HandleGetVersionResponse(
uint8* _data );
280 void HandleGetRandomResponse(
uint8* _data );
281 void HandleGetControllerCapabilitiesResponse(
uint8* _data );
282 void HandleGetSerialAPICapabilitiesResponse(
uint8* _data );
283 void HandleSerialAPISoftResetResponse(
uint8* _data );
284 void HandleEnableSUCResponse(
uint8* _data );
285 void HandleSetSUCNodeIdResponse(
uint8* _data );
286 void HandleGetSUCNodeIdResponse(
uint8* _data );
287 void HandleMemoryGetIdResponse(
uint8* _data );
300 void HandleSerialAPIGetInitDataResponse(
uint8* _data );
301 void HandleGetNodeProtocolInfoResponse(
uint8* _data );
302 bool HandleRemoveFailedNodeResponse(
uint8* _data );
303 void HandleIsFailedNodeResponse(
uint8* _data );
304 bool HandleReplaceFailedNodeResponse(
uint8* _data );
305 bool HandleAssignReturnRouteResponse(
uint8* _data );
306 bool HandleDeleteReturnRouteResponse(
uint8* _data );
307 void HandleSendNodeInformationRequest(
uint8* _data );
308 void HandleSendDataResponse(
uint8* _data,
bool _replication );
309 bool HandleNetworkUpdateResponse(
uint8* _data );
310 void HandleGetRoutingInfoResponse(
uint8* _data );
312 void HandleSendDataRequest(
uint8* _data,
bool _replication );
313 void HandleAddNodeToNetworkRequest(
uint8* _data );
314 void HandleCreateNewPrimaryRequest(
uint8* _data );
315 void HandleControllerChangeRequest(
uint8* _data );
316 void HandleSetLearnModeRequest(
uint8* _data );
317 void HandleRemoveFailedNodeRequest(
uint8* _data );
318 void HandleReplaceFailedNodeRequest(
uint8* _data );
319 void HandleRemoveNodeFromNetworkRequest(
uint8* _data );
320 void HandleApplicationCommandHandlerRequest(
uint8* _data,
bool encrypted );
321 void HandlePromiscuousApplicationCommandHandlerRequest(
uint8* _data );
322 void HandleAssignReturnRouteRequest(
uint8* _data );
323 void HandleDeleteReturnRouteRequest(
uint8* _data );
324 void HandleNodeNeighborUpdateRequest(
uint8* _data );
325 void HandleNetworkUpdateRequest(
uint8* _data );
326 bool HandleApplicationUpdateRequest(
uint8* _data );
327 bool HandleRfPowerLevelSetResponse(
uint8* _data );
328 bool HandleSerialApiSetTimeoutsResponse(
uint8* _data );
329 bool HandleMemoryGetByteResponse(
uint8* _data );
330 bool HandleReadMemoryResponse(
uint8* _data );
331 void HandleGetVirtualNodesResponse(
uint8* _data );
332 bool HandleSetSlaveLearnModeResponse(
uint8* _data );
333 void HandleSetSlaveLearnModeRequest(
uint8* _data );
334 bool HandleSendSlaveNodeInfoResponse(
uint8* _data );
335 void HandleSendSlaveNodeInfoRequest(
uint8* _data );
336 void HandleApplicationSlaveCommandRequest(
uint8* _data );
337 void HandleSerialAPIResetRequest(
uint8* _data );
339 void CommonAddNodeStatusRequestHandler(
uint8 _funcId,
uint8* _data );
341 bool m_waitingForAck;
342 uint8 m_expectedCallbackId;
343 uint8 m_expectedReply;
344 uint8 m_expectedCommandClassId;
345 uint8 m_expectedNodeId;
351 int32 GetPollInterval(){
return m_pollInterval ; }
352 void SetPollInterval(
int32 _milliseconds,
bool _bIntervalBetweenPolls ){ m_pollInterval = _milliseconds; m_bIntervalBetweenPolls = _bIntervalBetweenPolls; }
353 bool EnablePoll(
const ValueID &_valueId,
uint8 _intensity = 1 );
354 bool DisablePoll(
const ValueID &_valueId );
355 bool isPolled(
const ValueID &_valueId );
356 void SetPollIntensity(
const ValueID &_valueId,
uint8 _intensity );
357 static void PollThreadEntryPoint(
Event* _exitEvent,
void* _context );
358 void PollThreadProc(
Event* _exitEvent );
367 list<PollEntry> m_pollList;
370 int32 m_pollInterval;
371 bool m_bIntervalBetweenPolls;
391 void InitNode(
uint8 const _nodeId,
bool newNode =
false,
bool secure =
false,
uint8 const *_protocolInfo =
NULL,
uint8 const _length = 0);
395 bool IsNodeListeningDevice(
uint8 const _nodeId );
396 bool IsNodeFrequentListeningDevice(
uint8 const _nodeId );
397 bool IsNodeBeamingDevice(
uint8 const _nodeId );
398 bool IsNodeRoutingDevice(
uint8 const _nodeId );
399 bool IsNodeSecurityDevice(
uint8 const _nodeId );
406 string GetNodeType(
uint8 const _nodeId );
409 string GetNodeManufacturerName(
uint8 const _nodeId );
410 string GetNodeProductName(
uint8 const _nodeId );
411 string GetNodeName(
uint8 const _nodeId );
412 string GetNodeLocation(
uint8 const _nodeId );
414 string GetNodeDeviceTypeString(
uint8 const _nodeId );
416 string GetNodeRoleString(
uint8 const _nodeId );
418 string GetNodePlusTypeString (
uint8 const _nodeId );
419 bool IsNodeZWavePlus(
uint8 const _nodeId );
422 uint16 GetNodeManufacturerId(
uint8 const _nodeId );
425 void SetNodeManufacturerName(
uint8 const _nodeId,
string const& _manufacturerName );
426 void SetNodeProductName(
uint8 const _nodeId,
string const& _productName );
427 void SetNodeName(
uint8 const _nodeId,
string const& _nodeName );
428 void SetNodeLocation(
uint8 const _nodeId,
string const& _location );
429 void SetNodeLevel(
uint8 const _nodeId,
uint8 const _level );
430 void SetNodeOn(
uint8 const _nodeId );
431 void SetNodeOff(
uint8 const _nodeId );
435 bool IsAPICallSupported(
uint8 const _apinum )
const{
return (( m_apiMask[( _apinum - 1 ) >> 3] & ( 1 << (( _apinum - 1 ) & 0x07 ))) != 0 ); }
436 void SetAPICall(
uint8 const _apinum,
bool _toSet )
440 m_apiMask[( _apinum - 1 ) >> 3] |= ( 1 << (( _apinum - 1 ) & 0x07 ));
444 m_apiMask[( _apinum - 1 ) >> 3] &= ~( 1 << (( _apinum - 1 ) & 0x07 ));
460 ControllerCommand_None = 0,
476 ControllerCommand_DeleteButton
486 ControllerState_Normal = 0,
496 ControllerState_NodeFailed
505 ControllerError_None = 0,
517 ControllerError_Overflow
524 void ResetController(
Event* _evt );
526 void RequestNodeNeighbors(
uint8 const _nodeId,
uint32 const _requestFlags );
528 bool BeginControllerCommand(
ControllerCommand _command, pfnControllerCallback_t _callback,
void* _context,
bool _highPower,
uint8 _nodeId,
uint8 _arg );
529 bool CancelControllerCommand();
530 void AddNodeStop(
uint8 const _funcId );
532 struct ControllerCommandItem
535 bool m_controllerStateChanged;
536 bool m_controllerCommandDone;
538 pfnControllerCallback_t m_controllerCallback;
540 void* m_controllerCallbackContext;
542 bool m_controllerAdded;
543 uint8 m_controllerCommandNode;
544 uint8 m_controllerCommandArg;
545 uint8 m_controllerDeviceProtocolInfo[254];
546 uint8 m_controllerDeviceProtocolInfoLength;
549 ControllerCommandItem* m_currentControllerCommand;
551 void DoControllerCommand();
556 void UpdateNodeRoutes(
uint8 const_nodeId,
bool _doUpdate =
false );
558 Event* m_controllerResetEvent;
566 MsgQueue_Command = 0,
602 bool WriteNextMsg(
MsgQueue const _queue );
603 bool WriteMsg(
string const &str);
604 void RemoveCurrentMsg();
605 bool MoveMessagesToWakeUpQueue(
uint8 const _targetNodeId,
bool const _move );
606 bool HandleErrorResponse(
uint8 const _error,
uint8 const _nodeId,
char const* _funcStr,
bool _sleepCheck =
false );
607 bool IsExpectedReply(
uint8 const _nodeId );
610 void CheckCompletedNodeQueries();
648 MsgQueueCmd_SendMsg = 0,
649 MsgQueueCmd_QueryStageComplete,
650 MsgQueueCmd_Controller
664 bool operator == ( MsgQueueItem
const& _other )
const 666 if( _other.m_command == m_command )
668 if( m_command == MsgQueueCmd_SendMsg )
670 return( (*_other.m_msg) == (*m_msg) );
672 else if( m_command == MsgQueueCmd_QueryStageComplete )
674 return( (_other.m_nodeId == m_nodeId) && (_other.m_queryStage == m_queryStage) );
676 else if( m_command == MsgQueueCmd_Controller )
678 return( (_other.m_cci->m_controllerCommand == m_cci->m_controllerCommand) && (_other.m_cci->m_controllerCallback == m_cci->m_controllerCallback) );
685 MsgQueueCmd m_command;
690 ControllerCommandItem* m_cci;
694 list<MsgQueueItem> m_msgQueue[MsgQueue_Count];
696 Event* m_queueEvent[MsgQueue_Count];
706 void TestNetwork(
uint8 const _nodeId,
uint32 const _count );
718 void RequestVirtualNeighbors(
MsgQueue const _queue );
719 bool IsVirtualNode(
uint8 const _nodeId )
const{
return (( m_virtualNeighbors[( _nodeId - 1 ) >> 3] & 1 << (( _nodeId - 1 ) & 0x07 )) != 0 ); }
720 void SendVirtualNodeInfo(
uint8 const _fromNodeId,
uint8 const _ToNodeId );
721 void SendSlaveLearnModeOff();
723 void ReadButtons(
uint8 const _nodeId );
725 bool m_virtualNeighborsReceived;
741 bool SetConfigParam(
uint8 const _nodeId,
uint8 const _param,
int32 _value,
uint8 const _size );
742 void RequestConfigParam(
uint8 const _nodeId,
uint8 const _param );
752 uint8 GetMaxAssociations(
uint8 const _nodeId,
uint8 const _groupIdx );
753 string GetGroupLabel(
uint8 const _nodeId,
uint8 const _groupIdx );
754 void AddAssociation(
uint8 const _nodeId,
uint8 const _groupIdx,
uint8 const _targetNodeId,
uint8 const _instance = 0x00 );
755 void RemoveAssociation(
uint8 const _nodeId,
uint8 const _groupIdx,
uint8 const _targetNodeId,
uint8 const _instance = 0x00 );
762 void NotifyWatchers();
765 list<Notification*> m_notifications;
767 Event* m_notificationsEvent;
798 void LogDriverStatistics();
801 void GetDriverStatistics(
DriverData* _data );
823 uint32 m_broadcastReadCnt;
824 uint32 m_broadcastWriteCnt;
835 bool isNetworkKeySet();
838 bool initNetworkKeys(
bool newnode);
839 uint8 *GetNetworkKey();
840 bool SendEncryptedMessage();
841 bool SendNonceRequest(
string logmsg);
842 void SendNonceKey(
uint8 nodeId,
uint8 *nonce);
845 uint8 m_nonceReportSent;
846 uint8 m_nonceReportSentAttempt;
847 bool m_inclusionkeySet;
Implements COMMAND_CLASS_NO_OPERATION (0x00), a Z-Wave device command class.
Definition: NoOperation.h:37
uint32 m_CANCnt
Definition: Driver.h:781
Implements COMMAND_CLASS_ASSOCIATION (0x85), a Z-Wave device command class.
Definition: Association.h:38
Message object to be passed to and from devices on the Z-Wave network.
Definition: Msg.h:44
Definition: Bitfield.h:34
Container that holds all of the values associated with a given node.
Definition: ValueStore.h:43
MsgQueue
Definition: Driver.h:564
Definition: Security.h:63
uint8 GetTargetNodeId() const
Identifies the Node ID of the "target" node (if any) for this function.
Definition: Msg.h:66
#define OPENZWAVE_EXPORT
Definition: Defs.h:52
Implements COMMAND_CLASS_MANUFACTURER_SPECIFIC (0x72), a Z-Wave device command class.
Definition: ManufacturerSpecific.h:38
unsigned short uint16
Definition: Defs.h:77
#define OPENZWAVE_EXPORT_WARNINGS_ON
Definition: Defs.h:54
uint32 m_routedbusy
Definition: Driver.h:793
Definition: Controller.h:41
Platform-independent definition of event objects.
Definition: Event.h:39
uint32 m_nondelivery
Definition: Driver.h:792
uint8 GetTransmitOptions() const
Definition: Driver.h:582
uint32 m_readAborts
Definition: Driver.h:777
Implements COMMAND_CLASS_WAKE_UP (0x84), a Z-Wave device command class.
Definition: WakeUp.h:43
The main public interface to OpenZWave.
Definition: Manager.h:109
uint32 m_ACKWaiting
Definition: Driver.h:776
Implements a platform-independent thread management class.
Definition: Thread.h:42
QueryStage
Definition: Node.h:134
uint32 m_badChecksum
Definition: Driver.h:778
uint32 m_writeCnt
Definition: Driver.h:780
#define OPENZWAVE_EXPORT_WARNINGS_OFF
Definition: Defs.h:53
The Node class describes a Z-Wave node object...typically a device on the Z-Wave network.
Definition: Node.h:64
#define NULL
Definition: Defs.h:70
ControllerCommand
Definition: Driver.h:458
uint32 m_readCnt
Definition: Driver.h:779
Base class for all Z-Wave command classes.
Definition: CommandClass.h:46
ControllerError
Definition: Driver.h:503
uint32 m_OOFCnt
Definition: Driver.h:784
ControllerState
Definition: Driver.h:484
uint32 m_notidle
Definition: Driver.h:791
uint32 m_SOFCnt
Definition: Driver.h:775
ControllerInterface
Definition: Driver.h:82
uint32 m_broadcastReadCnt
Definition: Driver.h:794
The Driver class handles communication between OpenZWave and a device attached via a serial port (typ...
Definition: Driver.h:58
Implements COMMAND_CLASS_SCENEACTIVATION (0x2B), a Z-Wave device command class.
Definition: SceneActivation.h:39
uint32 m_badroutes
Definition: Driver.h:788
signed int int32
Definition: Defs.h:79
unsigned int uint32
Definition: Defs.h:80
uint8 GetNodeNumber(Msg const *_msg) const
Definition: Driver.h:377
Manages a group of devices (various nodes associated with each other).
Definition: Group.h:49
Provides a container for data sent via the notification callback handler installed by a call to Manag...
Definition: Notification.h:42
uint32 m_broadcastWriteCnt
Definition: Driver.h:795
Provides a unique ID for a value reported by a Z-Wave device.
Definition: ValueID.h:53
uint32 m_callbacks
Definition: Driver.h:787
uint32 m_netbusy
Definition: Driver.h:790
Implements a platform-independent mutex–for serializing access to a shared resource.
Definition: Mutex.h:39
uint32 m_retries
Definition: Driver.h:786
uint32 m_noack
Definition: Driver.h:789
Implements a platform-independent TimeStamp.
Definition: TimeStamp.h:39
Base class for values associated with a node.
Definition: Value.h:47
uint32 m_dropped
Definition: Driver.h:785
uint32 m_NAKCnt
Definition: Driver.h:782
Implements COMMAND_CLASS_NODE_NAMING (0x77), a Z-Wave device command class.
Definition: NodeNaming.h:37
Implements COMMAND_CLASS_CONTROLLER_REPLICATION (0x21), a Z-Wave device command class.
Definition: ControllerReplication.h:37
uint32 m_ACKCnt
Definition: Driver.h:783
Implements COMMAND_CLASS_BASIC (0x20), a Z-Wave device command class.
Definition: Basic.h:39
#define NUM_NODE_BITFIELD_BYTES
Definition: Defs.h:222
unsigned char uint8
Definition: Defs.h:74