|
|
|
@ -1443,6 +1443,7 @@ bool pOnvif::ptz_GetStatus( CSTR profileToken, ptzStatus *tStatus ){ |
|
|
|
char tBuffer[DEFAULT_BUFFER_SIZE]; |
|
|
|
accessToken tTOKEN; |
|
|
|
tTOKEN = _makeToken(); |
|
|
|
memset( tStatus, 0, sizeof(ptzStatus)); |
|
|
|
sprintf( tBuffer, PONVIF_PACK_GET_PTZ_STATUS, tTOKEN.USERNAME, tTOKEN.PASSDIGEST, tTOKEN.NONCE, tTOKEN.TIMESTAMP, profileToken ); |
|
|
|
if( _send_request( m_pPTZURI, tBuffer, true ) ){ |
|
|
|
XMLResults tParseResults; |
|
|
|
@ -1457,8 +1458,7 @@ bool pOnvif::ptz_GetStatus( CSTR profileToken, ptzStatus *tStatus ){ |
|
|
|
XMLNode bNode = aNode.getChildNode("GetStatusResponse", 0); |
|
|
|
if( !bNode.isEmpty() ) { |
|
|
|
XMLNode cNode = bNode.getChildNode("PTZStatus", 0 ); |
|
|
|
if(!cNode.isEmpty()) { |
|
|
|
memset( tStatus, 0, sizeof(ptzStatus)); |
|
|
|
if(!cNode.isEmpty()) { |
|
|
|
XMLNode dNode = cNode.getChildNode("Position", 0 ); |
|
|
|
if(!dNode.isEmpty()) { |
|
|
|
XMLNode eNode = dNode.getChildNode("PanTilt", 0 ); |
|
|
|
@ -1477,18 +1477,20 @@ bool pOnvif::ptz_GetStatus( CSTR profileToken, ptzStatus *tStatus ){ |
|
|
|
tStatus->zoom = atof( fNode.getAttribute("x") ); //ZZ.lpszValue );
|
|
|
|
}; |
|
|
|
}; |
|
|
|
XMLNode gNode = cNode.getChildNode("MoveStatus", 0 ); |
|
|
|
if(!gNode.isEmpty()){ |
|
|
|
tStatus->hasMoveStatus = true; |
|
|
|
XMLNode hNode = gNode.getChildNode("PanTilt", 0 ); |
|
|
|
if( !hNode.isEmpty()) { |
|
|
|
if( strstr( hNode.getText(0),"IDLE" ) != NULL ) tStatus->PanTiltIdle = true; |
|
|
|
}; |
|
|
|
XMLNode iNode = gNode.getChildNode("Zoom", 0 ); |
|
|
|
if( !iNode.isEmpty()) { |
|
|
|
if( strstr( iNode.getText(0),"IDLE" ) != NULL ) tStatus->ZoomIdle = true; |
|
|
|
if ( tStatus->pan != .0f || tStatus->tilt != .0f || tStatus->zoom != .0f ) { |
|
|
|
XMLNode gNode = cNode.getChildNode("MoveStatus", 0); |
|
|
|
if(!gNode.isEmpty()){ |
|
|
|
tStatus->hasMoveStatus = true; |
|
|
|
XMLNode hNode = gNode.getChildNode("PanTilt", 0 ); |
|
|
|
if( !hNode.isEmpty()) { |
|
|
|
if( strstr( hNode.getText(0),"IDLE" ) != NULL ) tStatus->PanTiltIdle = true; |
|
|
|
}; |
|
|
|
XMLNode iNode = gNode.getChildNode("Zoom", 0 ); |
|
|
|
if( !iNode.isEmpty()) { |
|
|
|
if( strstr( iNode.getText(0),"IDLE" ) != NULL ) tStatus->ZoomIdle = true; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
return true; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|