MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / BeginControllerCommand

Method BeginControllerCommand

cpp/src/Driver.cpp:5394–5433  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Start the controller performing one of its network management functions Create a ControllerCommand request. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

5392// Create a ControllerCommand request.
5393//-----------------------------------------------------------------------------
5394bool Driver::BeginControllerCommand
5395(
5396 ControllerCommand _command,
5397 pfnControllerCallback_t _callback,
5398 void* _context,
5399 bool _highPower,
5400 uint8 _nodeId,
5401 uint8 _arg
5402)
5403{
5404 ControllerCommandItem* cci;
5405 MsgQueueItem item;
5406
5407 if( _command == ControllerCommand_None )
5408 {
5409 return false;
5410 }
5411
5412 Log::Write( LogLevel_Detail, _nodeId, "Queuing (%s) %s", c_sendQueueNames[MsgQueue_Controller], c_controllerCommandNames[_command] );
5413 cci = new ControllerCommandItem();
5414 cci->m_controllerCommand = _command;
5415 cci->m_controllerCallback = _callback;
5416 cci->m_controllerCallbackContext = _context;
5417 cci->m_highPower = _highPower;
5418 cci->m_controllerCommandNode = _nodeId;
5419 cci->m_controllerCommandArg = _arg;
5420 cci->m_controllerState = ControllerState_Normal;
5421 cci->m_controllerStateChanged = false;
5422 cci->m_controllerCommandDone = false;
5423
5424 item.m_command = MsgQueueCmd_Controller;
5425 item.m_cci = cci;
5426
5427 m_sendMutex->Lock();
5428 m_msgQueue[MsgQueue_Controller].push_back( item );
5429 m_queueEvent[MsgQueue_Controller]->Set();
5430 m_sendMutex->Unlock();
5431
5432 return true;
5433}
5434
5435//-----------------------------------------------------------------------------
5436// <Driver::DoControllerCommand>

Callers 1

SendPendingMethod · 0.45

Calls 4

WriteFunction · 0.85
LockMethod · 0.45
SetMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected