Created
August 9, 2023 10:17
-
-
Save adisuciu/c6df9360214967dd290a66424422fde6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <iio.h> | |
#define URI "ip:192.168.2.1" | |
int main() { | |
unsigned int major; | |
unsigned int minor; | |
char git_tag[8]; | |
const char *description; | |
const char *ctx_name; | |
const char *ctx_val; | |
struct iio_context *ctx; | |
iio_library_get_version(&major, &minor, git_tag); | |
printf("libiio version: %d.%d - %s \n", major,minor,git_tag); | |
ctx = iio_create_context_from_uri(URI); | |
description = iio_context_get_description(ctx); | |
printf("Description: %s\n" , description); | |
iio_context_get_attr(ctx,0,&ctx_name,&ctx_val); | |
printf("ctx attr %d: %s - %s\n" ,0, ctx_name, ctx_val); | |
iio_context_destroy(ctx); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment