XnStatus XnSensorDepthStream::CloseRangeControl(XnBool bEnabled) { XnStatus nRetVal = XN_STATUS_OK; if (bEnabled) { nRetVal = XnHostProtocolWriteAHB(m_Helper.GetPrivateData(), 0x2a0038d4, 0x0, 0xFFF); XN_IS_STATUS_OK(nRetVal); nRetVal = XnHostProtocolWriteAHB(m_Helper.GetPrivateData(), 0x2a003820, 0x00001009, 0xFFFFFFFF); XN_IS_STATUS_OK(nRetVal); nRetVal = m_Helper.SimpleSetFirmwareParam(m_Gain, 1); XN_IS_STATUS_OK(nRetVal); } else { if (m_CloseRange.GetValue() == TRUE) { nRetVal = XnHostProtocolWriteAHB(m_Helper.GetPrivateData(), 0x2a0038d4, 0x190, 0xFFF); XN_IS_STATUS_OK(nRetVal); nRetVal = XnHostProtocolWriteAHB(m_Helper.GetPrivateData(), 0x2a003820, 0x00001051, 0xFFFFFFFF); XN_IS_STATUS_OK(nRetVal); nRetVal = m_Helper.SimpleSetFirmwareParam(m_Gain, 42); XN_IS_STATUS_OK(nRetVal); } } return (XN_STATUS_OK); }
XnStatus XnSensor::WriteAHB(const XnAHBData* pAHB) { XnStatus nRetVal = XN_STATUS_OK; nRetVal = XnHostProtocolWriteAHB(&m_DevicePrivateData, pAHB->nRegister, pAHB->nValue, pAHB->nMask); XN_IS_STATUS_OK(nRetVal); return (XN_STATUS_OK); }