summaryrefslogtreecommitdiffstats
path: root/pci.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-04-14 04:21:38 +0200
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-04-14 04:21:38 +0200
commitb70ed8b6ccf17a7c5b4339f05a33471eaf3b33e5 (patch)
treea608941197e4ea1fa87a47cad013e3a7c768ca41 /pci.c
parent0d9e1cfca235f68e55a4d81e60409110b8ccde41 (diff)
downloadipecamera-b70ed8b6ccf17a7c5b4339f05a33471eaf3b33e5.tar.gz
ipecamera-b70ed8b6ccf17a7c5b4339f05a33471eaf3b33e5.tar.bz2
ipecamera-b70ed8b6ccf17a7c5b4339f05a33471eaf3b33e5.tar.xz
ipecamera-b70ed8b6ccf17a7c5b4339f05a33471eaf3b33e5.zip
Support non-callback way of getting events
Diffstat (limited to 'pci.c')
-rw-r--r--pci.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/pci.c b/pci.c
index a3f09db..df1025e 100644
--- a/pci.c
+++ b/pci.c
@@ -688,6 +688,24 @@ int pcilib_stop(pcilib_t *ctx) {
return 0;
}
+pcilib_event_id_t pcilib_get_next_event(pcilib_t *ctx, pcilib_event_t event_mask) {
+ pcilib_event_api_description_t *api;
+
+ pcilib_model_t model = pcilib_get_model(ctx);
+
+ api = pcilib_model[model].event_api;
+ if (!api) {
+ pcilib_error("Event API is not supported by the selected model");
+ return PCILIB_ERROR_NOTSUPPORTED;
+ }
+
+ if (api->next_event)
+ return api->next_event(ctx->event_ctx, event_mask);
+
+ pcilib_error("Event enumeration is not suppored by API");
+ return PCILIB_EVENT_ID_INVALID;
+}
+
int pcilib_trigger(pcilib_t *ctx, pcilib_event_t event, size_t trigger_size, void *trigger_data) {
pcilib_event_api_description_t *api;