# UniTAP.dev.ports.modules.capturer.event.event_capturer

class EventCapturer:

Class `EventCapturer` allows working with capturing events on Sink (RX - receiver) side. You can `start` capturing in several modes, `stop` capturing, getting current `status` and result of capturing `capture_result`.

EventCapturer( capturer: UniTAP.dev.modules.capturer.capture.Capturer, port_id: int, event_filter: list)
status: UniTAP.dev.modules.capturer.statuses.EventCaptureStatus

Returns current event capturer status.

###### Returns:

> object of `VideoCaptureStatus` type

capture_result: UniTAP.dev.ports.modules.capturer.event.result_event.ResultEventObject

Returns result of event capturing.

###### Returns:

> object of `ResultEventObject` type

def event_filter(self, event_filter_type: Type[~EventFilterType]) -> ~EventFilterType:

Returns event filter for current `EventCapturer`.

###### Returns:

> object of one of available [EventFilterDpRx, EventFilterDpTx, EventFilterHdRx, EventFilterHdTx, EventFilterUsbc] type

def configure_capturer( self, event_filter: Union[ UniTAP.dev.ports.modules.capturer.event.event_types.EventFilterDpRx , UniTAP.dev.ports.modules.capturer.event.event_types.EventFilterDpTx , UniTAP.dev.ports.modules.capturer.event.event_types.EventFilterHdRx , UniTAP.dev.ports.modules.capturer.event.event_types.EventFilterHdTx , UniTAP.dev.ports.modules.capturer.event.event_types.EventFilterUsbc ]):

Configure

###### Arguments:

- event_filter (Union[EventFilterDpRx, EventFilterDpTx, EventFilterHdRx, EventFilterHdTx, EventFilterUsbc])

def clear_capturer_config(self):

Clear event captuter configuration (filter).

def start(self, sec=0, n_elements=0):

Start capturing. Possible some variants of capturing:

- Capture with fixed event count (will be captured fixed event count and capturing will be stopped)
- Capture with fixed time (capturing will be continued fixed seconds and capturing will be stopped).
- Capture without parameters Live capturing (for getting events you need to use functions `pop_element` and `pop_all_elements`). Here you need to manually call the `stop` after capture.

All results can be obtained using the function `capture_result`.

###### Arguments:

- n_elements (int)
- sec (int)

def stop(self):

Stop capture events.

def pop_element(self) -> UniTAP.dev.ports.modules.capturer.event.event_types.EventData:

Return first captured object of `EventData`.

###### Returns:

> object of `EventData` type or `ResultEventObject`

def pop_all_elements( self) -> List[ UniTAP.dev.ports.modules.capturer.event.event_types.EventData ]:

Return all captured event frames(objects of `EventData`).

###### Returns:

> object of list[`EventData`] type

def pop_all_elements_as_result_object( self) -> UniTAP.dev.ports.modules.capturer.event.result_event.ResultEventObject:

Return all captured event frames(objects of `EventData`) as `ResultEventObject`.

###### Returns:

> object of `ResultEventObject` type