diff options
author | Tony Theodore <tonyt@logyst.com> | 2017-11-18 07:10:13 (GMT) |
---|---|---|
committer | Tony Theodore <tonyt@logyst.com> | 2017-11-18 07:10:13 (GMT) |
commit | 621bd95acc69de1f1b6f997bd3931d11c9d7f94e (patch) | |
tree | b2feed2a45af67475edd4e9d8c38d9e14d90b21e /src/libsigrok-test.c | |
parent | ee36fd05505e3eb96b8119d7d59a118beb3f282f (diff) | |
download | mxe-621bd95acc69de1f1b6f997bd3931d11c9d7f94e.zip mxe-621bd95acc69de1f1b6f997bd3931d11c9d7f94e.tar.gz mxe-621bd95acc69de1f1b6f997bd3931d11c9d7f94e.tar.bz2 |
add libsigrok and libserialport
Diffstat (limited to 'src/libsigrok-test.c')
-rw-r--r-- | src/libsigrok-test.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/libsigrok-test.c b/src/libsigrok-test.c new file mode 100644 index 0000000..cfb23c6 --- /dev/null +++ b/src/libsigrok-test.c @@ -0,0 +1,26 @@ +/* + * This file is part of MXE. See LICENSE.md for licensing information. + */ + +#include <stdio.h> +#include <libsigrok/libsigrok.h> + +int main(int argc, char **argv) +{ + int ret; + struct sr_context *sr_ctx; + (void)argc; + (void)argv; + + if ((ret = sr_init(&sr_ctx)) != SR_OK) { + printf("Error initializing libsigrok (%s): %s.\n", + sr_strerror_name(ret), sr_strerror(ret)); + return 1; + } + if ((ret = sr_exit(sr_ctx)) != SR_OK) { + printf("Error shutting down libsigrok (%s): %s.\n", + sr_strerror_name(ret), sr_strerror(ret)); + return 1; + } + return 0; +} |