From fabed5f21324473a5b1345ce5d4ff8807715e7eb Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 20 Jul 2017 11:50:55 -0700 Subject: C API: Added constructor for empty sensor value handles' --- host/lib/types/sensors_c.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'host/lib/types') diff --git a/host/lib/types/sensors_c.cpp b/host/lib/types/sensors_c.cpp index cec4fbaff..5760b0c7e 100644 --- a/host/lib/types/sensors_c.cpp +++ b/host/lib/types/sensors_c.cpp @@ -20,6 +20,21 @@ #include #include +uhd_error uhd_sensor_value_make( + uhd_sensor_value_handle* h +){ + try{ + *h = new uhd_sensor_value_t; + } + catch(...){ + return UHD_ERROR_UNKNOWN; + } + + UHD_SAFE_C_SAVE_ERROR((*h), + (*h)->sensor_value_cpp = new uhd::sensor_value_t("", false, "", ""); + ) +} + uhd_error uhd_sensor_value_make_from_bool( uhd_sensor_value_handle* h, const char* name, -- cgit v1.2.3