def _control_callback(self, port, buf):
    try:
        if (buf.command == mmal.MMAL_EVENT_ERROR):
            raise PiCameraRuntimeError('No data recevied from sensor. Check all connections, including the SUNNY chip on the camera board')
        elif (buf.command != mmal.MMAL_EVENT_PARAMETER_CHANGED):
            raise PiCameraRuntimeError(('Received unexpected camera control callback event, 0x%08x' % buf[0].cmd))
    except Exception as exc:
        self._camera_exception = exc
def _control_callback(self, port, buf):
    try:
        if (buf.command == mmal.MMAL_EVENT_ERROR):
            raise PiCameraRuntimeError('No data recevied from sensor. Check all connections, including the SUNNY chip on the camera board')
        elif (buf.command != mmal.MMAL_EVENT_PARAMETER_CHANGED):
            raise PiCameraRuntimeError(('Received unexpected camera control callback event, 0x%08x' % buf[0].cmd))
    except Exception as exc:
        self._camera_exception = exc