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

Method HandleGetVersionResponse

cpp/src/Driver.cpp:2515–2548  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Process a response from the Z-Wave PC interface -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2513// Process a response from the Z-Wave PC interface
2514//-----------------------------------------------------------------------------
2515void Driver::HandleGetVersionResponse
2516(
2517 uint8* _data
2518)
2519{
2520 m_libraryVersion = (char*)&_data[2];
2521
2522 m_libraryType = _data[m_libraryVersion.size()+3];
2523 if( m_libraryType < 9 )
2524 {
2525 m_libraryTypeName = c_libraryTypeNames[m_libraryType];
2526 }
2527 Log::Write( LogLevel_Info, GetNodeNumber( m_currentMsg ), "Received reply to FUNC_ID_ZW_GET_VERSION:" );
2528 Log::Write( LogLevel_Info, GetNodeNumber( m_currentMsg ), " %s library, version %s", m_libraryTypeName.c_str(), m_libraryVersion.c_str() );
2529 if ( !((m_libraryType == ZW_LIB_CONTROLLER_STATIC ) || (m_libraryType == ZW_LIB_CONTROLLER)) ) {
2530 Log::Write( LogLevel_Fatal, GetNodeNumber( m_currentMsg), "Z-Wave Interface is not a Supported Library Type: %s", m_libraryTypeName.c_str());
2531 Log::Write( LogLevel_Fatal, GetNodeNumber( m_currentMsg), "Z-Wave Interface should be a Static Controller Library Type");
2532
2533 {
2534 Notification* notification = new Notification( Notification::Type_UserAlerts );
2535 notification->SetUserAlertNofification( Notification::Alert_UnsupportedController );
2536 QueueNotification( notification );
2537 }
2538 {
2539 Notification* notification = new Notification(Notification::Type_DriverFailed);
2540 notification->SetHomeAndNodeIds(m_homeId, m_currentMsg->GetTargetNodeId());
2541 notification->SetComPort(m_controllerPath);
2542 QueueNotification(notification);
2543 }
2544 NotifyWatchers();
2545 m_driverThread->Stop();
2546 }
2547 return;
2548}
2549
2550//-----------------------------------------------------------------------------
2551// <Driver::HandleGetRandomResponse>

Callers

nothing calls this directly

Calls 4

WriteFunction · 0.85
StopMethod · 0.80
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected