aboutsummaryrefslogtreecommitdiff
path: root/tests/test-rpc_get_version.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-rpc_get_version.c')
-rw-r--r--tests/test-rpc_get_version.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test-rpc_get_version.c b/tests/test-rpc_get_version.c
new file mode 100644
index 0000000..84869c3
--- /dev/null
+++ b/tests/test-rpc_get_version.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+#include <assert.h>
+
+#include <hal.h>
+#include <hal_internal.h>
+
+int main (int argc, char *argv[])
+{
+ uint32_t version;
+
+#define check(op) { hal_error_t err; if ((err = (op)) != HAL_OK) { printf("%s: %s\n", #op, hal_error_string(err)); return 1; } }
+
+ check(hal_rpc_client_init());
+ check(hal_rpc_get_version(&version));
+ printf("%08x\n", version);
+
+ return 0;
+}